MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / writeI53ToI64Clamped_double

Function writeI53ToI64Clamped_double

test/core/test_int53.c:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void writeI53ToI64Clamped_double(int64_t *heapAddress, double num) {
44#ifdef GENERATE_ANSWERS
45 if (num >= 9223372036854775808.0)
46 *heapAddress = 0x7FFFFFFFFFFFFFFFLL;
47 else if (num <= -9223372036854775808.0)
48 *heapAddress = -0x8000000000000000LL;
49 else if (num > 0)
50 *(uint64_t*)heapAddress = (uint64_t)num;
51 else
52 *heapAddress = (int64_t)num;
53#else
54 EM_ASM(writeI53ToI64Clamped($0, $1), heapAddress, num);
55#endif
56}
57
58void writeI53ToI64Signaling_double(int64_t *heapAddress, double num) {
59#ifdef GENERATE_ANSWERS

Callers 1

mainFunction · 0.85

Calls 1

EM_ASMFunction · 0.50

Tested by

no test coverage detected