~ubuntu-branches/ubuntu/precise/eglibc/precise

« back to all changes in this revision

Viewing changes to math/w_lgamma_r.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-10-04 17:48:26 UTC
  • mfrom: (216.1.23 oneiric)
  • Revision ID: package-import@ubuntu.com-20111004174826-2cyb9ewn3ucymlsx
Tags: 2.13-20ubuntu5
libc6-dev: Don't break the current {gnat,gcj}-4.4-base versons. LP: #853688.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * ====================================================
11
11
 */
12
12
 
 
13
#if defined(LIBM_SCCS) && !defined(lint)
 
14
static char rcsid[] = "$NetBSD: w_lgamma_r.c,v 1.6 1995/05/10 20:49:27 jtc Exp $";
 
15
#endif
 
16
 
13
17
/*
14
18
 * wrapper double lgamma_r(double x, int *signgamp)
15
19
 */
16
20
 
17
21
#include <math.h>
18
 
#include <math_private.h>
19
 
 
20
 
 
21
 
double
22
 
__lgamma_r(double x, int *signgamp)
 
22
#include "math_private.h"
 
23
 
 
24
 
 
25
#ifdef __STDC__
 
26
        double __lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */
 
27
#else
 
28
        double __lgamma_r(x,signgamp)              /* wrapper lgamma_r */
 
29
        double x; int *signgamp;
 
30
#endif
23
31
{
24
 
        double y = __ieee754_lgamma_r(x,signgamp);
25
 
        if(__builtin_expect(!__finite(y), 0)
26
 
           && __finite(x) && _LIB_VERSION != _IEEE_)
27
 
                return __kernel_standard(x, x,
28
 
                                         __floor(x)==x&&x<=0.0
29
 
                                         ? 15 /* lgamma pole */
30
 
                                         : 14); /* lgamma overflow */
31
 
 
32
 
        return y;
 
32
#ifdef _IEEE_LIBM
 
33
        return __ieee754_lgamma_r(x,signgamp);
 
34
#else
 
35
        double y;
 
36
        y = __ieee754_lgamma_r(x,signgamp);
 
37
        if(_LIB_VERSION == _IEEE_) return y;
 
38
        if(!__finite(y)&&__finite(x)) {
 
39
            if(__floor(x)==x&&x<=0.0)
 
40
                return __kernel_standard(x,x,15); /* lgamma pole */
 
41
            else
 
42
                return __kernel_standard(x,x,14); /* lgamma overflow */
 
43
        } else
 
44
            return y;
 
45
#endif
33
46
}
34
47
weak_alias (__lgamma_r, lgamma_r)
35
48
#ifdef NO_LONG_DOUBLE