From 3737a0d70cac3ba09aa8f32709c4be8d70f41207 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sun, 28 Dec 2003 18:57:35 +0000 Subject: Do not raise execptions for exp(NaN). --- sysdeps/ieee754/dbl-64/e_exp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c index a6463e5..717469e 100644 --- a/sysdeps/ieee754/dbl-64/e_exp.c +++ b/sysdeps/ieee754/dbl-64/e_exp.c @@ -92,10 +92,10 @@ double __ieee754_exp(double x) { if (n <= smallint) return 1.0; if (n >= badint) { - if (n > infint) return(zero/zero); /* x is NaN, return invalid */ + if (n > infint) return(x+x); /* x is NaN */ if (n < infint) return ( (x>0) ? (hhuge*hhuge) : (tiny*tiny) ); /* x is finite, cause either overflow or underflow */ - if (junk1.i[LOW_HALF] != 0) return (zero/zero); /* x is NaN */ + if (junk1.i[LOW_HALF] != 0) return (x+x); /* x is NaN */ return ((x>0)?inf.x:zero ); /* |x| = inf; return either inf or 0 */ } -- cgit v1.1