title: What are the chances of Math.random returning 0?
body: <p>Like the asker of <a href="https://stackoverflow.com/q/15830658/9513577">this question</a>, I was wondering why <code>Math.ceil(Math.random() * 10)</code> was not preferred over <code>Math.floor(Math.random() * 10) + 1</code>, and found that it was because Math.random has a tiny (but relevant) chance of returning 0 exactly. But how tiny?</p>
  
  <p>Further research told me that <a href="https://stackoverflow.com/a/3344463/9513577">this random number is accurate to 16 decimal places... well, sort of.</a> And it's the "sort of" that I'm curious about.</p>
  
  <p>I understand that floating point numbers work differently to decimals. I struggle with the specifics though. If the number were a strict decimal value, I believe the chances would be one in ten billiard (or ten quadrillion, in the American system) - 1:10<sup>16</sup>.</p>
  
  <p>Is this correct, or have I messed up, or does the floating point thing make a difference?</p>