summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/e_powf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/e_powf.c')
-rw-r--r--lib/msun/src/e_powf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c
index 466ed72..5c46478 100644
--- a/lib/msun/src/e_powf.c
+++ b/lib/msun/src/e_powf.c
@@ -67,6 +67,9 @@ __ieee754_powf(float x, float y)
/* y==zero: x**0 = 1 */
if(iy==0) return one;
+ /* x==1: 1**y = 1, even if y is NaN */
+ if (hx==0x3f800000) return one;
+
/* y!=zero: result is NaN if either arg is NaN */
if(ix > 0x7f800000 ||
iy > 0x7f800000)
@@ -90,7 +93,7 @@ __ieee754_powf(float x, float y)
/* special value of y */
if (iy==0x7f800000) { /* y is +-inf */
if (ix==0x3f800000)
- return y - y; /* inf**+-1 is NaN */
+ return one; /* (-1)**+-inf is NaN */
else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */
return (hy>=0)? y: zero;
else /* (|x|<1)**-,+inf = inf,0 */
OpenPOWER on IntegriCloud