summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-96
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-05-05 19:37:39 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-05-05 19:37:39 +0000
commit41498f4db1ebfeb2fb76b9137cba38c20000f1d3 (patch)
treee546d5a208020a4dc1598ea46d5c819e9a1a20c0 /sysdeps/ieee754/ldbl-96
parent6698b8bf4365f09d5bb467e113068f210811b001 (diff)
downloadglibc-41498f4db1ebfeb2fb76b9137cba38c20000f1d3.tar.gz
Fix missing exceptions from exp (bugs 13787, 13922, 14036).
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r--sysdeps/ieee754/ldbl-96/w_expl.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/sysdeps/ieee754/ldbl-96/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl.c
index 55c68462bd..79b10c5756 100644
--- a/sysdeps/ieee754/ldbl-96/w_expl.c
+++ b/sysdeps/ieee754/ldbl-96/w_expl.c
@@ -19,29 +19,16 @@
#include <math.h>
#include <math_private.h>
-static const long double
-o_threshold= 1.135652340629414394949193107797076489134e4,
- /* 0x400C, 0xB17217F7, 0xD1CF79AC */
-u_threshold= -1.140019167866942050398521670162263001513e4;
- /* 0x400C, 0xB220C447, 0x69C201E8 */
-
-
/* wrapper expl */
long double
__expl (long double x)
{
- if (__builtin_expect (isgreater (x, o_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 206);
- }
- else if (__builtin_expect (isless (x, u_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 207);
- }
+ long double z = __ieee754_expl (x);
+ if (__builtin_expect (!__finitel (z) || z == 0, 0)
+ && __finitel (x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_l (x, x, 206 + !!__signbitl (x));
- return __ieee754_expl (x);
+ return z;
}
hidden_def (__expl)
weak_alias (__expl, expl)