1 /* wrf_lgamma.c -- float version of wr_lgamma.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
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
13 * ====================================================
17 * wrapper float lgammaf_r(float x, int *signgamp)
24 float lgammaf_r(float x
, int *signgamp
) /* wrapper lgammaf_r */
26 float lgammaf_r(x
,signgamp
) /* wrapper lgammaf_r */
27 float x
; int *signgamp
;
31 return __ieee754_lgammaf_r(x
,signgamp
);
35 y
= __ieee754_lgammaf_r(x
,signgamp
);
36 if(_LIB_VERSION
== _IEEE_
) return y
;
37 if(!finitef(y
)&&finitef(x
)) {
42 SET_HIGH_WORD(inf
,0x7ff00000); /* set inf to infinite */
46 exc
.arg1
= exc
.arg2
= (double)x
;
47 if (_LIB_VERSION
== _SVID_
)
50 exc
.retval
= HUGE_VAL
;
51 if(floorf(x
)==x
&&x
<=(float)0.0) {
52 /* lgammaf(-integer) or lgamma(0) */
54 if (_LIB_VERSION
== _POSIX_
)
56 else if (!matherr(&exc
)) {
61 /* lgammaf(finite) overflow */
63 if (_LIB_VERSION
== _POSIX_
)
65 else if (!matherr(&exc
)) {
71 return (float)exc
.retval
;