summaryrefslogtreecommitdiff
path: root/src/math/tgamma.c
blob: af5f38f4412ea7ed0d23d02fd5f993dccb51ca1a (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
36
#if 0

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

TYPE TGFN(tgamma)(TYPE x)
{
	switch (fpclassify(x)) {
	case FP_ZERO:
		feraiseexcept(FE_DIVBYZERO);
		return signbit(x) ? - INFINITY : INFINITY;

	case FP_INFINITE:
		if (signbit(x)) {
			feraiseexcept(FE_INVALID);
			return NAN;
		} else {
			return INFINITY;
		}

	default:
		break;
	}

	return x;
}

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


#endif