Debian Codegraph @

js/src/jit-test/tests/basic/truncateDouble.js

raw
1
2 // check correctness of truncation of doubles slightly outside the int32_t range.
3
4 function truncate(x) {
5 return x | 0;
6 }
7
8 assertEq(truncate(0xffffffff), -1);
9 assertEq(truncate(0xffffffff + 5000.5), 4999);
10 assertEq(truncate(-0xffffffff - 5000.5), -4999);