title: Why HTML rand command keep produce more than 0.5
body: <p>I was coding to understand how html work but I could not understand the <code>Math.random()</code> function fully.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  Value:&lt;br&gt; &lt;p id="Value"&gt; 0 &lt;/p&gt;
  &lt;div&gt;
  &lt;/div&gt;
  
  &lt;p&gt;Click the button to increase the value.&lt;/p&gt;
  
  &lt;button onclick="increase()"+",this.blur()" id="demp" style="position:relative; left: 500px; top: 80px; width: 64px; height: 64px;"&gt;Increase&lt;/button&gt;
  
  &lt;script&gt;
  function increase() {
      var x = document.getElementById("Value").innerHTML;
      var increased = parseInt(x,10) + parseInt(1,10);
      document.getElementById("Value").innerHTML = increased;
  }
  
  function change(){
      var num = 0;
      window.setInterval(function(){
      var speedx= Math.floor((Math.random() * 10) - 5);
      var speedy= Math.floor((Math.random() * 10) - 5);
      document.getElementById("demp").style.left= parseInt(document.getElementById("demp").style.left, 10) + parseInt(speedx,10) +"px"; 
      document.getElementById("demp").style.top= parseInt(document.getElementById("demp").style.top, 10) + parseInt(speedy,10) +"px"; 
      }, 10)
  }
  window.onload = function start() {
      change();
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have created a button which is changing it's position according to <code>Math.random()</code> value. I refresh the page like 30 times and my button always going up and left. That means <code>math.random()</code> function produce greater then 0.5
  Can you explain why it doesn't produce real random numbers and how can I create a real random number? </p>