diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
commit | 7988979a722b4cdf287b2093956a76a3f19b9897 (patch) | |
tree | d35e251d0472ceca55a2eef61cff261c8ee68fab /test/math/signgam.c |
add uClibc-ng test directory
Diffstat (limited to 'test/math/signgam.c')
-rw-r--r-- | test/math/signgam.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/math/signgam.c b/test/math/signgam.c new file mode 100644 index 0000000..2f1adba --- /dev/null +++ b/test/math/signgam.c @@ -0,0 +1,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; +} |