summaryrefslogtreecommitdiff
path: root/test/math/signgam.c
blob: 2f1adbaad75a9b50104230cc33cbbf2959f9763b (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
#define _XOPEN_SOURCE 600
#include <math.h>
#include <float.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;
}