diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-23 14:35:12 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-23 14:35:12 +0100 |
commit | 1b738e61aeee7bb704859bda3eaadb6d804cd3f0 (patch) | |
tree | c39e2284657259b840ca7dc4dc44016a92d18240 /tests | |
parent | 210bc77d871bd3eac6696ca4749aaaa61148428e (diff) |
fix fmin
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 3967cce7..3f17cf2c 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1368,6 +1368,7 @@ c5,de,15,8a def test_floatvars(self): src = ''' #include <stdio.h> + #include <math.h> int main() { float x = 1.234, y = 3.5, q = 0.00000001; @@ -1375,6 +1376,8 @@ c5,de,15,8a int z = x < y; printf("*%d,%d,%.1f,%d,%.4f,%.2f*\\n", z, int(y), y, (int)x, x, q); + printf("%.2f, %.2f, %.2f, %.2f\\n", fmin(0.5, 3.3), fmin(NAN, 3.3), fmax(0.5, 3.3), fmax(NAN, 3.3)); + /* // Rounding behavior float fs[6] = { -2.75, -2.50, -2.25, 2.25, 2.50, 2.75 }; @@ -1386,7 +1389,7 @@ c5,de,15,8a return 0; } ''' - self.do_run(src, '*1,10,10.5,1,1.2340,0.00*') + self.do_run(src, '*1,10,10.5,1,1.2340,0.00*\n0.50, 3.30, 3.30, 3.30\n') def test_globaldoubles(self): src = r''' |