tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bug889451.js (383B)


      1 /*
      2 js> (((-1 >>> 1) + 1) * Math.pow(2, 52 - 30) + 1) & 1         
      3 0
      4 js> (((-1 >> 1) + 1) * Math.pow(2, 52 - 30) + 1) & 1 
      5 1
      6 */
      7 
      8 function f(x) {
      9  if (x >= 0) {
     10    // if it does not fail, try with lower power of 2.
     11    return (((x >>> 1) + 1) * 4194304 /* 2 ** (52 - 30) */ + 1) & 1;
     12  }
     13  return 2;
     14 }
     15 
     16 assertEq(f(-1 >>> 1), 1);
     17 assertEq(f(-1 >>> 0), 0);
     18 assertEq(f(-1 >>> 0), 0);