1 
2 
3 /* @(#)w_pow.c 1.3 95/01/18 */
4 /*
5  * ====================================================
6  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7  *
8  * Developed at SunSoft, a Sun Microsystems, Inc. business.
9  * Permission to use, copy, modify, and distribute this
10  * software is freely granted, provided that this notice
11  * is preserved.
12  * ====================================================
13  */
14 
15 /*
16  * wrapper ieee_pow(x,y) return x**y
17  */
18 
19 #include "fdlibm.h"
20 
21 
22 #ifdef __STDC__
ieee_pow(double x,double y)23 	double ieee_pow(double x, double y)	/* wrapper pow */
24 #else
25 	double ieee_pow(x,y)			/* wrapper pow */
26 	double x,y;
27 #endif
28 {
29 #ifdef _IEEE_LIBM
30 	return  __ieee754_pow(x,y);
31 #else
32 	double z;
33 	z=__ieee754_pow(x,y);
34 	if(_LIB_VERSION == _IEEE_|| ieee_isnan(y)) return z;
35 	if(ieee_isnan(x)) {
36 	    if(y==0.0)
37 	        return __kernel_standard(x,y,42); /* ieee_pow(NaN,0.0) */
38 	    else
39 		return z;
40 	}
41 	if(x==0.0){
42 	    if(y==0.0)
43 	        return __kernel_standard(x,y,20); /* ieee_pow(0.0,0.0) */
44 	    if(ieee_finite(y)&&y<0.0)
45 	        return __kernel_standard(x,y,23); /* ieee_pow(0.0,negative) */
46 	    return z;
47 	}
48 	if(!ieee_finite(z)) {
49 	    if(ieee_finite(x)&&ieee_finite(y)) {
50 	        if(ieee_isnan(z))
51 	            return __kernel_standard(x,y,24); /* pow neg**non-int */
52 	        else
53 	            return __kernel_standard(x,y,21); /* pow overflow */
54 	    }
55 	}
56 	if(z==0.0&&ieee_finite(x)&&ieee_finite(y))
57 	    return __kernel_standard(x,y,22); /* pow underflow */
58 	return z;
59 #endif
60 }
61