| 30 | } |
| 31 | |
| 32 | void writeI53ToI64_double(int64_t *heapAddress, double num) { |
| 33 | #ifdef GENERATE_ANSWERS |
| 34 | if (num > 0 || num <= -9223372036854775808.0 /* underflow, garbage in-garbage out situation: just produce a value that matches current JS impl*/) |
| 35 | *(uint64_t*)heapAddress = (uint64_t)num; |
| 36 | else |
| 37 | *heapAddress = (int64_t)num; |
| 38 | #else |
| 39 | EM_ASM(writeI53ToI64($0, $1), heapAddress, num); |
| 40 | #endif |
| 41 | } |
| 42 | |
| 43 | void writeI53ToI64Clamped_double(int64_t *heapAddress, double num) { |
| 44 | #ifdef GENERATE_ANSWERS |