From 41498f4db1ebfeb2fb76b9137cba38c20000f1d3 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sat, 5 May 2012 19:37:39 +0000 Subject: Fix missing exceptions from exp (bugs 13787, 13922, 14036). --- sysdeps/ieee754/ldbl-96/w_expl.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'sysdeps/ieee754/ldbl-96') 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 #include -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) -- cgit 1.4.1