summaryrefslogtreecommitdiff
path: root/test/math/signgam.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/math/signgam.c')
-rw-r--r--test/math/signgam.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/math/signgam.c b/test/math/signgam.c
index c60375aec..d79d6afb2 100644
--- a/test/math/signgam.c
+++ b/test/math/signgam.c
@@ -5,14 +5,23 @@
double zero = 0.0;
double mzero;
-int
-main (void)
+int main(void)
{
- double d;
- mzero = copysign (zero, -1.0);
- d = lgamma (zero);
- printf ("%g %d\n", d, signgam);
- d = lgamma (mzero);
- printf ("%g %d\n", d, signgam);
- return 0;
+ 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;
}