diff options
Diffstat (limited to 'math/test-misc.c')
-rw-r--r-- | math/test-misc.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/math/test-misc.c b/math/test-misc.c index 5a78574..a7b17d4 100644 --- a/math/test-misc.c +++ b/math/test-misc.c @@ -384,6 +384,24 @@ main (void) v2.ieee.negative); result = 1; } + + if (nextafterf (0.0f, INFINITY) != nextafterf (0.0f, 1.0f) + || nextafterf (-0.0f, INFINITY) != nextafterf (-0.0f, 1.0f) + || nextafterf (0.0f, -INFINITY) != nextafterf (0.0f, -1.0f) + || nextafterf (-0.0f, -INFINITY) != nextafterf (-0.0f, -1.0f)) + { + printf ("nextafterf (+-0, +-Inf) != nextafterf (+-0, +-1)\n"); + result = 1; + } + + if (nexttowardf (0.0f, INFINITY) != nexttowardf (0.0f, 1.0f) + || nexttowardf (-0.0f, INFINITY) != nexttowardf (-0.0f, 1.0f) + || nexttowardf (0.0f, -INFINITY) != nexttowardf (0.0f, -1.0f) + || nexttowardf (-0.0f, -INFINITY) != nexttowardf (-0.0f, -1.0f)) + { + printf ("nexttowardf (+-0, +-Inf) != nexttowardf (+-0, +-1)\n"); + result = 1; + } } { @@ -680,6 +698,24 @@ main (void) v2.ieee.negative); result = 1; } + + if (nextafter (0.0, INFINITY) != nextafter (0.0, 1.0) + || nextafter (-0.0, INFINITY) != nextafter (-0.0, 1.0) + || nextafter (0.0, -INFINITY) != nextafter (0.0, -1.0) + || nextafter (-0.0, -INFINITY) != nextafter (-0.0, -1.0)) + { + printf ("nextafter (+-0, +-Inf) != nextafter (+-0, +-1)\n"); + result = 1; + } + + if (nexttoward (0.0, INFINITY) != nexttoward (0.0, 1.0) + || nexttoward (-0.0, INFINITY) != nexttoward (-0.0, 1.0) + || nexttoward (0.0, -INFINITY) != nexttoward (0.0, -1.0) + || nexttoward (-0.0, -INFINITY) != nexttoward (-0.0, -1.0)) + { + printf ("nexttoward (+-0, +-Inf) != nexttoward (+-0, +-1)\n"); + result = 1; + } } #ifndef NO_LONG_DOUBLE @@ -980,6 +1016,24 @@ main (void) v2.ieee.negative); result = 1; } + + if (nextafterl (0.0, INFINITY) != nextafterl (0.0, 1.0) + || nextafterl (-0.0, INFINITY) != nextafterl (-0.0, 1.0) + || nextafterl (0.0, -INFINITY) != nextafterl (0.0, -1.0) + || nextafterl (-0.0, -INFINITY) != nextafterl (-0.0, -1.0)) + { + printf ("nextafterl (+-0, +-Inf) != nextafterl (+-0, +-1)\n"); + result = 1; + } + + if (nexttowardl (0.0L, INFINITY) != nexttowardl (0.0L, 1.0L) + || nexttowardl (-0.0L, INFINITY) != nexttowardl (-0.0L, 1.0L) + || nexttowardl (0.0L, -INFINITY) != nexttowardl (0.0L, -1.0L) + || nexttowardl (-0.0L, -INFINITY) != nexttowardl (-0.0L, -1.0L)) + { + printf ("nexttowardl (+-0, +-Inf) != nexttowardl (+-0, +-1)\n"); + result = 1; + } } #endif |