aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/libm-ieee754/w_powf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/w_powf.c')
-rw-r--r--sysdeps/libm-ieee754/w_powf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sysdeps/libm-ieee754/w_powf.c b/sysdeps/libm-ieee754/w_powf.c
index 3f9d5c8d5f..0b20822be8 100644
--- a/sysdeps/libm-ieee754/w_powf.c
+++ b/sysdeps/libm-ieee754/w_powf.c
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -17,7 +17,7 @@
static char rcsid[] = "$NetBSD: w_powf.c,v 1.3 1995/05/10 20:49:41 jtc Exp $";
#endif
-/*
+/*
* wrapper powf(x,y) return x**y
*/
@@ -39,19 +39,22 @@ static char rcsid[] = "$NetBSD: w_powf.c,v 1.3 1995/05/10 20:49:41 jtc Exp $";
z=__ieee754_powf(x,y);
if(_LIB_VERSION == _IEEE_|| __isnanf(y)) return z;
if(__isnanf(x)) {
- if(y==(float)0.0)
+ if(y==(float)0.0)
/* powf(NaN,0.0) */
return (float)__kernel_standard((double)x,(double)y,142);
- else
+ else
return z;
}
- if(x==(float)0.0){
+ if(x==(float)0.0){
if(y==(float)0.0)
/* powf(0.0,0.0) */
return (float)__kernel_standard((double)x,(double)y,120);
if(__finitef(y)&&y<(float)0.0)
+ if (signbit (x) && signbit (z))
/* powf(0.0,negative) */
return (float)__kernel_standard((double)x,(double)y,123);
+ else
+ return (float)__kernel_standard((double)x,(double)y,143);
return z;
}
if(!__finitef(z)) {
@@ -59,11 +62,11 @@ static char rcsid[] = "$NetBSD: w_powf.c,v 1.3 1995/05/10 20:49:41 jtc Exp $";
if(__isnanf(z))
/* powf neg**non-int */
return (float)__kernel_standard((double)x,(double)y,124);
- else
+ else
/* powf overflow */
return (float)__kernel_standard((double)x,(double)y,121);
}
- }
+ }
if(z==(float)0.0&&__finitef(x)&&__finitef(y))
/* powf underflow */
return (float)__kernel_standard((double)x,(double)y,122);