title: Unsigned Integer in Javascript
body: <p>I'm working on a page that processes IP address information, but it's choking on the fact that integers are signed. I am using bitwise operators to speed it up, but the 64th bit (signed/unsigned flag) is messing it up.</p>
  
  <p>Is there any way to force a number to be unsigned in Javascript? It seems to work fine, until subnet is greater than 30, or less than 2.</p>
  
  <p>Try this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
      &lt;body&gt;
      
      &lt;script type='text/javascript'&gt;
      document.write( (1 &lt;&lt; 30) +"&lt;br/&gt;");
      document.write( (1 &lt;&lt; 31) +"&lt;br/&gt;");
      document.write( (1 &lt;&lt; 32) +"&lt;br/&gt;");
      &lt;/script&gt;
      
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Result:</p>
  
  <blockquote>
    <p>1073741824
    -2147483648 
    1</p>
  </blockquote>