This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix cexp overflow (bug 13892)


On 03/22/2012 06:01 PM, Joseph S. Myers wrote:
This patch fixes bug 13892, internal overflows in cexp.  There are
clear-cut cases, where both real and imaginary parts should be finite
for a narrow range of real parts of the input even when exp (real part
of input) itself overflows, and also cases where one part should be
finite and the other infinite (because of the case of subnormals in
the input, this can occur with exponents more than twice as large as
that that would overflow exp - or of course with any finite positive
exponent if the real part of the input is zero).  The approach is
simply to subtract a suitable integer from the real part of the input
and multiply by exp of that integer, up to twice, to reduce the
exponent in cases that may have one of the parts of the result finite.

(There are no underflow problems with the cexp implementation, but I put
some tests for underflow cases - subnormal results - in anyway, since they
didn't seem to be covered by the testsuite before.)

thanks, this is ok,


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]