diff options
author | Joseph Myers <joseph@codesourcery.com> | 2016-06-13 17:27:19 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2016-06-13 17:27:19 +0000 |
commit | 88283451b26de29d08ba33148cf2f8cb2680f6f0 (patch) | |
tree | 334945ab68b411d9bac8696fbcaba40a6598ed2b /math | |
parent | b39b6e0c902f0bf5f99d593b8f5953943777c610 (diff) | |
download | glibc-88283451b26de29d08ba33148cf2f8cb2680f6f0.tar glibc-88283451b26de29d08ba33148cf2f8cb2680f6f0.tar.gz glibc-88283451b26de29d08ba33148cf2f8cb2680f6f0.tar.bz2 glibc-88283451b26de29d08ba33148cf2f8cb2680f6f0.zip |
Fix frexp (NaN) (bug 20250).
Various implementations of frexp functions return sNaN for sNaN
input. This patch fixes them to add such arguments to themselves so
that qNaN is returned.
Tested for x86_64, x86, mips64 and powerpc.
[BZ #20250]
* sysdeps/i386/fpu/s_frexpl.S (__frexpl): Add non-finite input to
itself.
* sysdeps/ieee754/dbl-64/s_frexp.c (__frexp): Add non-finite or
zero input to itself.
* sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c (__frexp):
Likewise.
* sysdeps/ieee754/flt-32/s_frexpf.c (__frexpf): Likewise.
* sysdeps/ieee754/ldbl-128/s_frexpl.c (__frexpl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Likewise.
* sysdeps/ieee754/ldbl-96/s_frexpl.c (__frexpl): Likewise.
* math/libm-test.inc (frexp_test_data): Add sNaN tests.
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 3d901ae96a..81ca896626 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -7760,6 +7760,8 @@ static const struct test_f_f1_data frexp_test_data[] = TEST_fI_f1 (frexp, minus_infty, minus_infty, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fI_f1 (frexp, qnan_value, qnan_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fI_f1 (frexp, -qnan_value, qnan_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fI_f1 (frexp, snan_value, qnan_value, IGNORE, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION), + TEST_fI_f1 (frexp, -snan_value, qnan_value, IGNORE, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION), TEST_fI_f1 (frexp, 0.0, 0.0, 0.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fI_f1 (frexp, minus_zero, minus_zero, 0.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), |