diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 8771baa10b2dc5bbedb08231d99c72cfd6abcb5b (patch) | |
tree | 87dbea36a0e5ed0f2f8e2a499b9c1014af6a38b5 /w_lgamma_r.c | |
download | fdlibm-8771baa10b2dc5bbedb08231d99c72cfd6abcb5b.tar.gz |
Initial Contributionandroid-1.0release-1.0cdma-import
Diffstat (limited to 'w_lgamma_r.c')
-rw-r--r-- | w_lgamma_r.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/w_lgamma_r.c b/w_lgamma_r.c new file mode 100644 index 0000000..c59e1d6 --- /dev/null +++ b/w_lgamma_r.c @@ -0,0 +1,42 @@ + +/* @(#)w_lgamma_r.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper double ieee_lgamma_r(double x, int *signgamp) + */ + +#include "fdlibm.h" + + +#ifdef __STDC__ + double ieee_lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */ +#else + double ieee_lgamma_r(x,signgamp) /* wrapper lgamma_r */ + double x; int *signgamp; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_lgamma_r(x,signgamp); +#else + double y; + y = __ieee754_lgamma_r(x,signgamp); + if(_LIB_VERSION == _IEEE_) return y; + if(!ieee_finite(y)&&ieee_finite(x)) { + if(ieee_floor(x)==x&&x<=0.0) + return __kernel_standard(x,x,15); /* lgamma pole */ + else + return __kernel_standard(x,x,14); /* lgamma overflow */ + } else + return y; +#endif +} |