Mercurial > hg > octave-nkf > gnulib-hg
comparison tests/test-round1.c @ 9854:baba3b346ab2
Use macros NaNf, NaNd, NaNl instead of NAN.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Wed, 02 Apr 2008 03:06:02 +0200 |
parents | 7f3ed6b093be |
children | 0be6f1ab456d |
comparison
equal
deleted
inserted
replaced
9853:41ff75af4085 | 9854:baba3b346ab2 |
---|---|
24 | 24 |
25 #include <stdio.h> | 25 #include <stdio.h> |
26 #include <stdlib.h> | 26 #include <stdlib.h> |
27 | 27 |
28 #include "isnand.h" | 28 #include "isnand.h" |
29 #include "nan.h" | |
29 | 30 |
30 #define ASSERT(expr) \ | 31 #define ASSERT(expr) \ |
31 do \ | 32 do \ |
32 { \ | 33 { \ |
33 if (!(expr)) \ | 34 if (!(expr)) \ |
72 ASSERT (round (-2.341e31) == -2.341e31); | 73 ASSERT (round (-2.341e31) == -2.341e31); |
73 /* Infinite numbers. */ | 74 /* Infinite numbers. */ |
74 ASSERT (round (1.0 / 0.0) == 1.0 / 0.0); | 75 ASSERT (round (1.0 / 0.0) == 1.0 / 0.0); |
75 ASSERT (round (-1.0 / 0.0) == -1.0 / 0.0); | 76 ASSERT (round (-1.0 / 0.0) == -1.0 / 0.0); |
76 /* NaNs. */ | 77 /* NaNs. */ |
77 ASSERT (isnand (round (NAN))); | 78 ASSERT (isnand (round (NaNd ()))); |
78 | 79 |
79 return 0; | 80 return 0; |
80 } | 81 } |