-1:000000000000 | 0:9478ecbed4bb |
---|---|
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); |