about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-04-04 17:35:12 +0200
committerThomas Schwinge <thomas@codesourcery.com>2013-04-05 22:34:52 +0200
commita1cbf437a53b24f2ff1f6af42028b607f6aa279d (patch)
tree3f62ac9a6413af55697ed6b154b400b518359406 /math
parent8b43a0c9f26d5cf067119e47df9973515535673f (diff)
downloadglibc-a1cbf437a53b24f2ff1f6af42028b607f6aa279d.tar.gz
glibc-a1cbf437a53b24f2ff1f6af42028b607f6aa279d.tar.xz
glibc-a1cbf437a53b24f2ff1f6af42028b607f6aa279d.zip
[BZ #14686, #15336] Fix standard compliance. Don't use hard-coded qNaN values.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 08c80fad42..92fa6a201a 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -11103,12 +11103,30 @@ remainder_test (void)
   TEST_ff_f (remainder, 1, minus_zero, qnan_value, INVALID_EXCEPTION);
   check_int ("errno for remainder(1, -0) = EDOM ", errno, EDOM, 0, 0, 0);
   errno = 0;
+  TEST_ff_f (remainder, plus_infty, minus_zero, qnan_value, INVALID_EXCEPTION);
+  check_int ("errno for remainder(INF, -0) = EDOM ", errno, EDOM, 0, 0, 0);
+  errno = 0;
+  TEST_ff_f (remainder, plus_infty, 0, qnan_value, INVALID_EXCEPTION);
+  check_int ("errno for remainder(INF, 0) = EDOM ", errno, EDOM, 0, 0, 0);
+  errno = 0;
   TEST_ff_f (remainder, plus_infty, 1, qnan_value, INVALID_EXCEPTION);
   check_int ("errno for remainder(INF, 1) = EDOM ", errno, EDOM, 0, 0, 0);
   errno = 0;
+  TEST_ff_f (remainder, plus_infty, 2, qnan_value, INVALID_EXCEPTION);
+  check_int ("errno for remainder(INF, 2) = EDOM ", errno, EDOM, 0, 0, 0);
+  errno = 0;
+  TEST_ff_f (remainder, minus_infty, minus_zero, qnan_value, INVALID_EXCEPTION);
+  check_int ("errno for remainder(-INF, -0) = EDOM ", errno, EDOM, 0, 0, 0);
+  errno = 0;
+  TEST_ff_f (remainder, minus_infty, 0, qnan_value, INVALID_EXCEPTION);
+  check_int ("errno for remainder(-INF, 0) = EDOM ", errno, EDOM, 0, 0, 0);
+  errno = 0;
   TEST_ff_f (remainder, minus_infty, 1, qnan_value, INVALID_EXCEPTION);
   check_int ("errno for remainder(-INF, 1) = EDOM ", errno, EDOM, 0, 0, 0);
   errno = 0;
+  TEST_ff_f (remainder, minus_infty, 2, qnan_value, INVALID_EXCEPTION);
+  check_int ("errno for remainder(-INF, 2) = EDOM ", errno, EDOM, 0, 0, 0);
+  errno = 0;
   TEST_ff_f (remainder, qnan_value, qnan_value, qnan_value);
   check_int ("errno for remainder(qNAN, qNAN) unchanged", errno, 0, 0, 0, 0);
   errno = 0;
@@ -11118,6 +11136,13 @@ remainder_test (void)
   TEST_ff_f (remainder, qnan_value, 0, qnan_value);
   check_int ("errno for remainder(qNaN, 0) unchanged", errno, 0, 0, 0, 0);
 
+  errno = 0;
+  TEST_ff_f (remainder, 7.0, plus_infty, 7.0);
+  check_int ("errno for remainder(7.0, INF) unchanged", errno, 0, 0, 0, 0);
+  errno = 0;
+  TEST_ff_f (remainder, 7.0, minus_infty, 7.0);
+  check_int ("errno for remainder(7.0, -INF) unchanged", errno, 0, 0, 0, 0);
+
   TEST_ff_f (remainder, 1.625, 1.0, -0.375);
   TEST_ff_f (remainder, -1.625, 1.0, 0.375);
   TEST_ff_f (remainder, 1.625, -1.0, -0.375);