aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_negative_zero.in
blob: 395f84ce5ec00fb57de7f79a0a098594fcf3978f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <math.h>

int main() {
#define TEST(x, y) printf("%.2f, %.2f ==> %.2f\n", x, y, copysign(x, y));
  TEST(5.0f, 5.0f);
  TEST(5.0f, -5.0f);
  TEST(-5.0f, 5.0f);
  TEST(-5.0f, -5.0f);
  TEST(5.0f, 4.0f);
  TEST(5.0f, -4.0f);
  TEST(-5.0f, 4.0f);
  TEST(-5.0f, -4.0f);
  TEST(0.0f, 5.0f);
  TEST(0.0f, -5.0f);
  TEST(-0.0f, 5.0f);
  TEST(-0.0f, -5.0f);
  TEST(5.0f, 0.0f);
  TEST(5.0f, -0.0f);
  TEST(-5.0f, 0.0f);
  TEST(-5.0f, -0.0f);
  TEST(0.0f, 0.0f);
  TEST(0.0f, -0.0f);
  TEST(-0.0f, 0.0f);
  TEST(-0.0f, -0.0f);
  return 0;
}