This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix missing overflow exceptions from pow (bug 13873)
On 04/09/2012 12:04 AM, Joseph S. Myers wrote:
Bug 13873 is a failure of pow to raise overflow exceptions on x86_64
when the absolute value of the exponent is so large that taking that
power of any floating-point value other than plus or minus zero, one,
infinity or NaN would overflow or underflow. I propose this patch to
fix this bug by doing computations at runtime that overflow or
underflow as required, as done in various other places in libm. (The
"huge" and "tiny" constants are the same as used for this purpose
elsewhere in dbl-64, so will be merged with the other instances since
glibc is built with -fmerge-all-constants.)
Tested x86 and x86_64.
2012-04-08 Joseph Myers<joseph@codesourcery.com>
[BZ #13873]
* sysdeps/ieee754/dbl-64/e_pow.c (huge, tiny): New variables.
(__ieee754_pow): Generate overflow and underflow using huge*huge
and tiny*tiny rather than just returning constant infinity or zero
for large exponents.
* math/libm-test.inc (pow_test): Require overflow exceptions for
applicable cases of large exponents.
thanks, this is fine,
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126