Back to index

glibc  2.9
w_lgammaf_r.c
Go to the documentation of this file.
00001 /* w_lgammaf_r.c -- float version of w_lgamma_r.c.
00002  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
00003  */
00004 
00005 /*
00006  * ====================================================
00007  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00008  *
00009  * Developed at SunPro, a Sun Microsystems, Inc. business.
00010  * Permission to use, copy, modify, and distribute this
00011  * software is freely granted, provided that this notice 
00012  * is preserved.
00013  * ====================================================
00014  */
00015 
00016 #if defined(LIBM_SCCS) && !defined(lint)
00017 static char rcsid[] = "$NetBSD: w_lgammaf_r.c,v 1.3 1995/05/10 20:49:32 jtc Exp $";
00018 #endif
00019 
00020 /* 
00021  * wrapper float lgammaf_r(float x, int *signgamp)
00022  */
00023 
00024 #include <math.h>
00025 #include "math_private.h"
00026 
00027 
00028 #ifdef __STDC__
00029        float __lgammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
00030 #else
00031        float __lgammaf_r(x,signgamp)              /* wrapper lgammaf_r */
00032         float x; int *signgamp;
00033 #endif
00034 {
00035 #ifdef _IEEE_LIBM
00036        return __ieee754_lgammaf_r(x,signgamp);
00037 #else
00038         float y;
00039         y = __ieee754_lgammaf_r(x,signgamp);
00040         if(_LIB_VERSION == _IEEE_) return y;
00041         if(!__finitef(y)&&__finitef(x)) {
00042             if(__floorf(x)==x&&x<=(float)0.0)
00043                /* lgamma pole */
00044                 return (float)__kernel_standard((double)x,(double)x,115);
00045             else
00046                /* lgamma overflow */
00047                return (float)__kernel_standard((double)x,(double)x,114);
00048         } else
00049             return y;
00050 #endif
00051 }             
00052 weak_alias (__lgammaf_r, lgammaf_r)