title: Simple math formula to make a number go 1, 2, 4, 8, 16 and so on
body: <p>math is not my strongest side so please someone help me with this formula:
  I have an ascending variabel y that goes to infinity.</p>
  
  <p>When:</p>
  
  <pre><code>y &lt; 100 I want x = 1,
  100 &gt;= y &lt; 200 I want x = 2,
  200 &gt;= y &lt; 300 I want x = 4,
  300 &gt;= y &lt; 400 I want x = 8
  400 &gt;= y &lt; 500 I want x = 16
  </code></pre>
  
  <p>and so on.</p>
  
  <p>Thanks in advance</p>