diff options
author | Andreas Jaeger <aj@suse.de> | 2011-10-07 15:14:06 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-07 15:14:06 -0400 |
commit | bf5824458cc584cfbbdfdb252bd38e8330c6f662 (patch) | |
tree | 2ad5582e3756baaf630b9cf3ac0658102c3da15e /math/libm-test.inc | |
parent | 48693bea9e2eff8abce31302c6c4bb8a0d101510 (diff) | |
download | glibc-bf5824458cc584cfbbdfdb252bd38e8330c6f662.tar.gz glibc-bf5824458cc584cfbbdfdb252bd38e8330c6f662.tar.xz glibc-bf5824458cc584cfbbdfdb252bd38e8330c6f662.zip |
Fix remainder (NaN, 0)
Diffstat (limited to 'math/libm-test.inc')
-rw-r--r-- | math/libm-test.inc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 70d936c0b0..96da7cde6b 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -189,7 +189,7 @@ static FLOAT max_error, real_max_error, imag_max_error; #define MANT_DIG CHOOSE ((LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1), \ - (LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1)) + (LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1)) static void init_max_error (void) @@ -4940,11 +4940,27 @@ remainder_test (void) START (remainder); + errno = 0; TEST_ff_f (remainder, 1, 0, nan_value, INVALID_EXCEPTION); + check_int ("errno for remainder(1, 0) = EDOM ", errno, EDOM, 0, 0, 0); + errno = 0; TEST_ff_f (remainder, 1, minus_zero, nan_value, INVALID_EXCEPTION); + check_int ("errno for remainder(1, -0) = EDOM ", errno, EDOM, 0, 0, 0); + errno = 0; TEST_ff_f (remainder, plus_infty, 1, nan_value, INVALID_EXCEPTION); + check_int ("errno for remainder(INF, 1) = EDOM ", errno, EDOM, 0, 0, 0); + errno = 0; TEST_ff_f (remainder, minus_infty, 1, nan_value, INVALID_EXCEPTION); + check_int ("errno for remainder(-INF, 1) = EDOM ", errno, EDOM, 0, 0, 0); + errno = 0; TEST_ff_f (remainder, nan_value, nan_value, nan_value); + check_int ("errno for remainder(NAN, NAN) unchanged", errno, 0, 0, 0, 0); + errno = 0; + TEST_ff_f (remainder, 0, nan_value, nan_value); + check_int ("errno for remainder(0, NAN) unchanged", errno, 0, 0, 0, 0); + errno = 0; + TEST_ff_f (remainder, nan_value, 0, nan_value); + check_int ("errno for remainder(NaN, 0) 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); |