title: What is the fastest way to generate a random integer in javascript?
body: <p>Normally this is how you get a random number in javascript.</p>
  <pre><code>Math.random();
  </code></pre>
  <p>However, this method seems to be inefficient when it comes to generating random integers.</p>
  <p>Firstly, the random function has to generate a random decimal, like <i><code>0.1036098338663578</code></i>, then it has to be multiplied to a suitable range (<i><code>10.464593220502138</code></i>). Finally, the floor function subtracts the decimals to produce the result (which in this case, <i><code>10</code></i>).</p>
  <pre><code>var random_integer = Math.floor(Math.random()*101);
  </code></pre>
  <p>Is there a faster way to generate random integers in javascript?</p>
  <h2>Edit1:</h2>
  <p>I am using this for creating a canvas HTML5 game. The FPS is about 50, and my code is pretty optimized, apart from generating a random number.</p>