blob: 2e1513abb2b9c3aad8e44707b29d5c1e769e2c78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
function f(x) {
return Math.imul(1, x >>> 0) / 9 | 0;
}
function g(x) {
return 1 * (x >>> 0) / 9 | 0;
}
function h(x) {
return (x >>> 0) / 9 | 0;
}
assertEq(0, f(4294967296));
assertEq(-238609294, f(2147483648));
assertEq(0, g(4294967296));
assertEq(238609294, g(2147483648));
assertEq(0, h(4294967296));
assertEq(238609294, h(2147483648));
|