1 2 3 4 5 6 7 8 9 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);