summaryrefslogtreecommitdiff
path: root/test/math/signgam.c
blob: d79d6afb2c5eff59b4fa1fe2c8edd009e7c96dea (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
#define _XOPEN_SOURCE 600
#include <math.h>
#include <stdio.h>

double zero = 0.0;
double mzero;

int main(void)
{
	double d;
	int errors = 0;

	mzero = copysign(zero, -1.0);

	d = lgamma(zero);
	printf("%g %d\n", d, signgam);
	errors += !(d == HUGE_VAL);
	errors += !(signgam == 1);

	d = lgamma(mzero);
	printf("%g %d\n", d, signgam);
	errors += !(d == HUGE_VAL);
	errors += !(signgam == -1);

	printf("Errors: %d\n", errors);
	return errors;
}