summaryrefslogtreecommitdiff
path: root/src/math/tgammaf.c
blob: 16df80762be2473486f8cc1ed0d0de6e33527610 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <math.h>

// FIXME: use lanczos approximation

float __lgammaf_r(float, int *);

float tgammaf(float x)
{
	int sign;
	float y;

	y = exp(__lgammaf_r(x, &sign));
	if (sign < 0)
		y = -y;
	return y;
}