diff options
Diffstat (limited to 'sysdeps/ieee754/dbl-64')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_exp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c index df3aa5efaa..9d35e6d66c 100644 --- a/sysdeps/ieee754/dbl-64/e_exp.c +++ b/sysdeps/ieee754/dbl-64/e_exp.c @@ -39,6 +39,7 @@ #include "uexp.tbl" #include <math_private.h> #include <fenv.h> +#include <float.h> #ifndef SECTION # define SECTION @@ -169,7 +170,7 @@ __ieee754_exp (double x) else { retval = __slowexp (x); - goto ret; + goto check_uflow_ret; } /*if error is over bound */ } ex = -(1022 + ex); @@ -185,13 +186,23 @@ __ieee754_exp (double x) { binexp.i[HIGH_HALF] = 0x00100000; retval = (res - 1.0) * binexp.x; - goto ret; + goto check_uflow_ret; } else { retval = __slowexp (x); - goto ret; + goto check_uflow_ret; } /* if error is over bound */ + check_uflow_ret: + if (retval < DBL_MIN) + { +#if FLT_EVAL_METHOD != 0 + volatile +#endif + double force_underflow = tiny * tiny; + math_force_eval (force_underflow); + } + goto ret; } else { |