1 /* w_gammaf.c -- float version of w_gamma.c. 2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 */ 4 5 /* 6 * ==================================================== 7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 * 9 * Developed at SunPro, a Sun Microsystems, Inc. business. 10 * Permission to use, copy, modify, and distribute this 11 * software is freely granted, provided that this notice 12 * is preserved. 13 * ==================================================== 14 */ 15 16 #include "math.h" 17 18 #ifdef __STDC__ tgammaf(float x)19 float tgammaf(float x) 20 #else 21 float tgammaf(x) 22 float x; 23 #endif 24 { 25 float y; 26 int local_signgam; 27 y = __ieee754_gammaf_r(x,&local_signgam); 28 if (local_signgam < 0) y = -y; 29 #ifdef _IEEE_LIBM 30 return y; 31 #else 32 if(_LIB_VERSION == _IEEE_) return y; 33 34 if(!finitef(y)&&finitef(x)) { 35 if(floorf(x)==x&&x<=(float)0.0) 36 /* tgammaf pole */ 37 return (float)__kernel_standard((double)x,(double)x,141); 38 else 39 /* tgammaf overflow */ 40 return (float)__kernel_standard((double)x,(double)x,140); 41 } 42 return y; 43 #endif 44 } 45