summaryrefslogtreecommitdiff
path: root/src/math/lgamma.c
blob: df2367ae24cca6ebc3b2ecae3b74dc28d2fb40e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#if 0

# define TGSOURCE "lgamma.c"
#include "_tgmath.h"
#include <math.h>
#include <fenv.h>

TYPE TGFN(lgamma)(TYPE x)
{
	switch (fpclassify(x)) {
	case FP_ZERO:		feraiseexcept(FE_DIVBYZERO); return INFINITY;
	case FP_INFINITE:	return INFINITY;
	default:		break;
	}

	if (x == 1.0 || x == 2.0) {
		return 0.0;
	}

	if (signbit(x)) {
		feraiseexcept(FE_DIVBYZERO);
		return INFINITY;
	}

	return x;
}

/*
STDC(199901)
XOPEN(4)
LINK(m)
*/


#endif