From 92221550d72bafcd322ac5ab2a951054184b7f1a Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 19 Feb 2012 11:20:18 +0100 Subject: Use non-signaling floating-point comparisons in math functions. --- math/w_exp2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'math/w_exp2.c') diff --git a/math/w_exp2.c b/math/w_exp2.c index bf22326..7a3b0af 100644 --- a/math/w_exp2.c +++ b/math/w_exp2.c @@ -12,7 +12,8 @@ static const double u_threshold = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1); double __exp2 (double x) { - if (__builtin_expect (x <= u_threshold || x > o_threshold, 0) + if (__builtin_expect (islessequal (x, u_threshold) + || isgreater (x, o_threshold), 0) && _LIB_VERSION != _IEEE_ && __finite (x)) /* exp2 overflow: 44, exp2 underflow: 45 */ return __kernel_standard (x, x, 44 + (x <= o_threshold)); -- cgit v1.1