bug1130679.js (487B)
1 function f(x) { 2 return x >>> 0 !== Math.imul(1, x >>> 0); 3 } 4 f(0) 5 assertEq(f(-1),true) 6 7 function g(x) { 8 return 2147483647+x !== Math.imul(1, 2147483647+x); 9 } 10 g(0) 11 assertEq(g(1),true) 12 13 function h(x) { 14 if (2147483647+x !== Math.imul(1, 2147483647+x)) 15 return true; 16 return (2147483647+x)|0 17 } 18 h(0) 19 assertEq(h(1), true) 20 21 function i2(x) { 22 return x === x 23 } 24 function i(x) { 25 return i2(0 / Math.sign(x > 0)) 26 } 27 i(1) 28 assertEq(i(-1), false)