summaryrefslogtreecommitdiff
path: root/test/math/signgam.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-06-10 22:20:17 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-06-10 22:23:54 +0200
commit0f0cf7ec49719ab3c357813689bf1095234d6533 (patch)
treea696368bfa111461e2501fceb0bb43dea5170aac /test/math/signgam.c
parent0671149ee68ee76d357c6dade14249fc9858d934 (diff)
lgamma: fix sign handling
add testcase from http://sourceware.org/bugzilla/show_bug.cgi?id=4407 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'test/math/signgam.c')
-rw-r--r--test/math/signgam.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/math/signgam.c b/test/math/signgam.c
new file mode 100644
index 000000000..c60375aec
--- /dev/null
+++ b/test/math/signgam.c
@@ -0,0 +1,18 @@
+#define _XOPEN_SOURCE 600
+#include <math.h>
+#include <stdio.h>
+
+double zero = 0.0;
+double mzero;
+
+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;
+}