diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2010-11-28 21:09:47 +0100 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2010-11-28 21:09:47 +0100 |
commit | 57f6cce72c889f2e7b342e87a565a064320a6ee2 (patch) | |
tree | 5466406472918d3adb63398f5fb9ea1511a5e73f /test/math/signgam.c | |
parent | 4ec89b87bc0eea8d9ca6b50564d12eeb3b1b0119 (diff) | |
parent | 5dea871ac73ef4608022c058b50adc946917f9b9 (diff) |
Merge commit 'origin/master' into prelink
Conflicts:
ldso/include/dl-hash.h
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'test/math/signgam.c')
-rw-r--r-- | test/math/signgam.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/test/math/signgam.c b/test/math/signgam.c index c60375aec..2f1adbaad 100644 --- a/test/math/signgam.c +++ b/test/math/signgam.c @@ -1,18 +1,28 @@ #define _XOPEN_SOURCE 600 #include <math.h> +#include <float.h> #include <stdio.h> 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; } |