diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/basic/truncateDouble.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/truncateDouble.js b/js/src/jit-test/tests/basic/truncateDouble.js new file mode 100644 index 0000000000..b5c4990768 --- /dev/null +++ b/js/src/jit-test/tests/basic/truncateDouble.js @@ -0,0 +1,10 @@ + +// check correctness of truncation of doubles slightly outside the int32_t range. + +function truncate(x) { + return x | 0; +} + +assertEq(truncate(0xffffffff), -1); +assertEq(truncate(0xffffffff + 5000.5), 4999); +assertEq(truncate(-0xffffffff - 5000.5), -4999); |