Skip to content

Commit

Permalink
[BZ #16427] Fix ldbl-128 exp overflows.
Browse files Browse the repository at this point in the history
Invoke the non-IEEE handling only for numbers special also in the IEEE
case.  This aligns the exp handling with the other ldbl variants.
  • Loading branch information
Andreas Krebbel committed Jan 15, 2014
1 parent c20d5bf commit 7beb48c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2014-01-15 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>

[BZ #16427]
* sysdeps/ieee754/ldbl-128/w_expl.c (__expl): Invoke the non-IEEE
handling only for numbers special also in the IEEE case.

2014-01-15 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>

* sysdeps/s390/fpu/libm-test-ulps: Regenerate.
Expand Down
18 changes: 5 additions & 13 deletions sysdeps/ieee754/ldbl-128/w_expl.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,16 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>

static const long double
o_threshold= 1.1356523406294143949491931077970763428449E4L,
u_threshold= -1.1433462743336297878837243843452621503410E4;

long double __expl(long double x) /* wrapper exp */
{
#ifdef _IEEE_LIBM
return __ieee754_expl(x);
#else
long double z;
z = __ieee754_expl(x);
if(_LIB_VERSION == _IEEE_) return z;
if(__finitel(x)) {
if(x>o_threshold)
return __kernel_standard_l(x,x,206); /* exp overflow */
else if(x<u_threshold)
return __kernel_standard_l(x,x,207); /* exp underflow */
}
long double z = __ieee754_expl (x);
if (__glibc_unlikely (!__finitel (z) || z == 0)
&& __finitel (x) && _LIB_VERSION != _IEEE_)
return __kernel_standard_l (x, x, 206 + !!__signbitl (x));

return z;
#endif
}
Expand Down

0 comments on commit 7beb48c

Please sign in to comment.