summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-02-22 13:01:20 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-02-22 13:01:20 +0000
commitfe45ce09f366f2260aef528d37ae35070b3a2a36 (patch)
treee9339ada3b50575aa63d7fa6cbc936dca6b69218 /math
parentff3b3d82781300d48abec8a4a1600e7486663705 (diff)
downloadglibc-fe45ce09f366f2260aef528d37ae35070b3a2a36.tar.gz
Fix rintf rounding.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc80
1 files changed, 80 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 6243e1ea3d..c8186c8147 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -5037,6 +5037,22 @@ rint_test (void)
TEST_f_f (rint, 262142.75, 262143.0);
TEST_f_f (rint, 524286.75, 524287.0);
TEST_f_f (rint, 524288.75, 524289.0);
+ TEST_f_f (rint, 1048576.75, 1048577.0);
+ TEST_f_f (rint, 2097152.75, 2097153.0);
+ TEST_f_f (rint, -1048576.75, -1048577.0);
+ TEST_f_f (rint, -2097152.75, -2097153.0);
+#ifndef TEST_FLOAT
+ TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
+ TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
+ TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
+ TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
+ TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
+ TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
+ TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
+ TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
+ TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
+ TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
+#endif
#ifdef TEST_LDOUBLE
/* The result can only be represented in long double. */
TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
@@ -5137,6 +5153,22 @@ rint_test_tonearest (void)
TEST_f_f (rint, -0.1, -0.0);
TEST_f_f (rint, -0.25, -0.0);
TEST_f_f (rint, -0.625, -1.0);
+ TEST_f_f (rint, 1048576.75, 1048577.0);
+ TEST_f_f (rint, 2097152.75, 2097153.0);
+ TEST_f_f (rint, -1048576.75, -1048577.0);
+ TEST_f_f (rint, -2097152.75, -2097153.0);
+#ifndef TEST_FLOAT
+ TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
+ TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
+ TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
+ TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
+ TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
+ TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
+ TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
+ TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
+ TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
+ TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
+#endif
#ifdef TEST_LDOUBLE
/* The result can only be represented in long double. */
TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
@@ -5207,6 +5239,22 @@ rint_test_towardzero (void)
TEST_f_f (rint, -0.1, -0.0);
TEST_f_f (rint, -0.25, -0.0);
TEST_f_f (rint, -0.625, -0.0);
+ TEST_f_f (rint, 1048576.75, 1048576.0);
+ TEST_f_f (rint, 2097152.75, 2097152.0);
+ TEST_f_f (rint, -1048576.75, -1048576.0);
+ TEST_f_f (rint, -2097152.75, -2097152.0);
+#ifndef TEST_FLOAT
+ TEST_f_f (rint, 70368744177664.75, 70368744177664.0);
+ TEST_f_f (rint, 140737488355328.75, 140737488355328.0);
+ TEST_f_f (rint, 281474976710656.75, 281474976710656.0);
+ TEST_f_f (rint, 562949953421312.75, 562949953421312.0);
+ TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0);
+ TEST_f_f (rint, -70368744177664.75, -70368744177664.0);
+ TEST_f_f (rint, -140737488355328.75, -140737488355328.0);
+ TEST_f_f (rint, -281474976710656.75, -281474976710656.0);
+ TEST_f_f (rint, -562949953421312.75, -562949953421312.0);
+ TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0);
+#endif
#ifdef TEST_LDOUBLE
/* The result can only be represented in long double. */
TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L);
@@ -5277,6 +5325,22 @@ rint_test_downward (void)
TEST_f_f (rint, -0.1, -1.0);
TEST_f_f (rint, -0.25, -1.0);
TEST_f_f (rint, -0.625, -1.0);
+ TEST_f_f (rint, 1048576.75, 1048576.0);
+ TEST_f_f (rint, 2097152.75, 2097152.0);
+ TEST_f_f (rint, -1048576.75, -1048577.0);
+ TEST_f_f (rint, -2097152.75, -2097153.0);
+#ifndef TEST_FLOAT
+ TEST_f_f (rint, 70368744177664.75, 70368744177664.0);
+ TEST_f_f (rint, 140737488355328.75, 140737488355328.0);
+ TEST_f_f (rint, 281474976710656.75, 281474976710656.0);
+ TEST_f_f (rint, 562949953421312.75, 562949953421312.0);
+ TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0);
+ TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
+ TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
+ TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
+ TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
+ TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
+#endif
#ifdef TEST_LDOUBLE
/* The result can only be represented in long double. */
TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L);
@@ -5347,6 +5411,22 @@ rint_test_upward (void)
TEST_f_f (rint, -0.1, -0.0);
TEST_f_f (rint, -0.25, -0.0);
TEST_f_f (rint, -0.625, -0.0);
+ TEST_f_f (rint, 1048576.75, 1048577.0);
+ TEST_f_f (rint, 2097152.75, 2097153.0);
+ TEST_f_f (rint, -1048576.75, -1048576.0);
+ TEST_f_f (rint, -2097152.75, -2097152.0);
+#ifndef TEST_FLOAT
+ TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
+ TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
+ TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
+ TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
+ TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
+ TEST_f_f (rint, -70368744177664.75, -70368744177664.0);
+ TEST_f_f (rint, -140737488355328.75, -140737488355328.0);
+ TEST_f_f (rint, -281474976710656.75, -281474976710656.0);
+ TEST_f_f (rint, -562949953421312.75, -562949953421312.0);
+ TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0);
+#endif
#ifdef TEST_LDOUBLE
/* The result can only be represented in long double. */
TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);