diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-12-07 03:25:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-12-07 03:25:24 +0000 |
commit | 64b02fd2f5fd5d2e2b7187b5e982fa6b59587500 (patch) | |
tree | 8b833557f08e0d9088bfbeb20af3389680cdc87f /math/bug-nextafter.c | |
parent | 57d20ee7f27850f2c14e7eeb1e64807e6431d469 (diff) | |
download | glibc-64b02fd2f5fd5d2e2b7187b5e982fa6b59587500.tar.gz glibc-64b02fd2f5fd5d2e2b7187b5e982fa6b59587500.tar.xz glibc-64b02fd2f5fd5d2e2b7187b5e982fa6b59587500.zip |
Update.
2003-12-06 Ulrich Drepper <drepper@redhat.com> * math/Makefile (tests): Add bug-nextafter. * math/bug-nextafter.c: New file. * sysdeps/generic/s_nextafter.c: Construct overflow value correctly. * sysdeps/ieee754/flt-32/s_nextafterf.c: Likewise. * math/libm-test.inc (nextafter_test): Add test for overflow after +/-FLT_MAX etc.
Diffstat (limited to 'math/bug-nextafter.c')
-rw-r--r-- | math/bug-nextafter.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/math/bug-nextafter.c b/math/bug-nextafter.c new file mode 100644 index 0000000000..8aa849df19 --- /dev/null +++ b/math/bug-nextafter.c @@ -0,0 +1,28 @@ +#include <math.h> +#include <float.h> +#include <stdlib.h> +#include <stdio.h> + +int +main (void) +{ + int result = 0; + + float i = INFINITY; + float m = FLT_MAX; + if (nextafterf (m, i) != i) + { + puts ("nextafterf failed"); + ++result; + } + + double di = INFINITY; + double dm = DBL_MAX; + if (nextafter (dm, di) != di) + { + puts ("nextafter failed"); + ++result; + } + + return result; +} |