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

Function copysign_bug

test/core/test_negative_zero.c:12–27  ·  view source on GitHub ↗

test copysign of 0

Source from the content-addressed store, hash-verified

10
11// test copysign of 0
12int __attribute__((noinline))
13copysign_bug (double x)
14{
15 if (x != 0.0 && (x * 0.5 == x)) {
16 printf("1\n");
17 return 1;
18 }
19 printf("f: %f\n", x);
20 if (__builtin_copysign(1.0, x) < 0.0) {
21 printf("2\n");
22 return 2;
23 } else {
24 printf("3\n");
25 return 3;
26 }
27}
28
29int main() {
30#define TEST(x, y) printf("%.2f, %.2f ==> %.2f\n", x, y, copysign(x, y));

Callers 1

mainFunction · 0.85

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected