aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/test-misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/math/test-misc.c b/math/test-misc.c
index 862e11f..1dc4d90 100644
--- a/math/test-misc.c
+++ b/math/test-misc.c
@@ -1235,5 +1235,22 @@ main (void)
}
#endif
+#if !defined NO_LONG_DOUBLE && LDBL_MANT_DIG >= DBL_MANT_DIG + 4
+ volatile long double ld5 = nextafter (0.0, 1.0) / 16.0L;
+ volatile double d5;
+ (void) &ld5;
+ int i;
+ for (i = 0; i <= 32; i++)
+ {
+ d5 = ld5 * i;
+ (void) &d5;
+ if (d5 != (i <= 8 ? 0 : i < 24 ? 1 : 2) * nextafter (0.0, 1.0))
+ {
+ printf ("%La incorrectly rounded to %a\n", ld5 * i, d5);
+ result = 1;
+ }
+ }
+#endif
+
return result;
}