base/math/w_gamma_r.c

Go to the documentation of this file.
00001 /* @(#)wr_gamma.c 5.1 93/09/24 */
00002 /*
00003  * ====================================================
00004  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00005  *
00006  * Developed at SunPro, a Sun Microsystems, Inc. business.
00007  * Permission to use, copy, modify, and distribute this
00008  * software is freely granted, provided that this notice 
00009  * is preserved.
00010  * ====================================================
00011  */
00012 
00013 #if defined(LIBM_SCCS) && !defined(lint)
00014 static char rcsid[] = "$NetBSD: w_gamma_r.c,v 1.7 1995/11/20 22:06:45 jtc Exp $";
00015 #endif
00016 
00017 /* 
00018  * wrapper double gamma_r(double x, int *signgamp)
00019  */
00020 
00021 #include "math.h"
00022 #include "mathP.h"
00023 
00024 
00025 #ifdef __STDC__
00026     double gamma_r(double x, int *signgamp) /* wrapper lgamma_r */
00027 #else
00028     double gamma_r(x,signgamp)              /* wrapper lgamma_r */
00029         double x; int *signgamp;
00030 #endif
00031 {
00032 #ifdef _IEEE_LIBM
00033     return __ieee754_lgamma_r(x,signgamp);
00034 #else
00035         double y;
00036         y = __ieee754_lgamma_r(x,signgamp);
00037         if(_LIB_VERSION == _IEEE_) return y;
00038         if(!finite(y)&&finite(x)) {
00039             if(floor(x)==x&&x<=0.0)
00040                 return __kernel_standard(x,x,41); /* gamma pole */
00041             else
00042                 return __kernel_standard(x,x,40); /* gamma overflow */
00043         } else
00044             return y;
00045 #endif
00046 }             

Generated on Tue Feb 2 17:46:05 2010 for RTAI API by  doxygen 1.4.7