glibc/sysdeps/ieee754
Joseph Myers 90ab295a9e Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916).
Various pow function implementations mishandle sNaN arguments in
various ways.  This includes returning sNaN instead of qNaN for sNaN
arguments.  For arguments (1, sNaN) and (sNaN, 0), TS 18661-1
semantics are also that the result should be qNaN, whereas with a qNaN
argument there the result should be 1, but for the dbl-64
implementation of pow there are issues with sNaN arguments beyond not
implementing the TS 18661-1 semantics in those special cases.

This patch makes the implementations in sysdeps/ieee754 follow the TS
18661-1 semantics consistently.  Because x86 / x86_64 implementations
still need fixing, testcases are not included with this patch; they
will be included with the fix for the x86 / x86_64 versions.

Tested for x86_64, x86, mips64 and powerpc (with such testcases, which
pass in the mips64 and powerpc cases).

	[BZ #20916]
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Do not return 1
	for arguments (sNaN, 0) or (1, sNaN).  Do arithmetic on NaN
	arguments to compute result.
	* sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Do not return
	1 for arguments (sNaN, 0) or (1, sNaN).
	* sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Likewise.
2016-12-02 23:21:15 +00:00
..
bits Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dbl-64 Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916). 2016-12-02 23:21:15 +00:00
flt-32 Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916). 2016-12-02 23:21:15 +00:00
ldbl-64-128 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl-96 Add setpayloadsig, setpayloadsigf, setpayloadsigl. 2016-11-24 23:56:48 +00:00
ldbl-128 Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916). 2016-12-02 23:21:15 +00:00
ldbl-128ibm Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916). 2016-12-02 23:21:15 +00:00
ldbl-opt Add llogb, llogbf, llogbl. 2016-12-02 01:42:49 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_standard.c Fix pow (qNaN, 0) result with -lieee (bug 20919), remove dead parts of wrappers. 2016-12-02 22:50:46 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_standardl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
s_lib_version.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_matherr.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_signgam.c Fix lgamma setting signgam for ISO C (bug 15421). 2015-11-20 22:49:59 +00:00