2 /* @(#)z_powf.c 1.0 98/08/13 */
7 float powf (float x
, float y
)
9 float d
, k
, t
, r
= 1.0;
10 int n
, sign
, exponent_is_even_int
= 0;
13 GET_FLOAT_WORD (px
, x
);
19 /* Exponent y is an integer. */
20 if (modff (ldexpf (y
, -1), &t
))
23 exponent_is_even_int
= 0;
28 exponent_is_even_int
= 1;
37 else if ((t
= y
* log (fabsf (x
))) >= BIGX
)
45 /* y is not an integer. */
49 else if (exponent_is_even_int
)
66 if ( !k
&& fabsf (d
) <= 32767 )
75 if ((unsigned int) n
% 2)
78 n
= (unsigned int) n
/ 2;
88 if ( px
& 0x80000000 )
93 /* y is not an integer. */
101 if (!exponent_is_even_int
)
105 /* y is an odd integer, and x is negative,
106 so the result is negative. */
107 GET_FLOAT_WORD (px
, x
);
109 SET_FLOAT_WORD (x
, px
);
118 #ifdef _DOUBLE_IS_32BITS
120 double pow (double x
, double y
)
122 return (double) powf ((float) x
, (float) y
);
125 #endif /* defined(_DOUBLE_IS_32BITS) */