summaryrefslogtreecommitdiff
path: root/tests/tcsch.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2006-10-25 17:49:57 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2006-10-25 17:49:57 +0000
commite2748856b898f29b86815d34982ff34a452655e5 (patch)
tree5d0c8301758d9fc0f4c56edd77a0135086c02afa /tests/tcsch.c
parent8e11845df8d98488067a7a612573b2fd1ff8cd9b (diff)
downloadmpfr-e2748856b898f29b86815d34982ff34a452655e5.tar.gz
fixed overflow/underflow problems in csch and sech
fixed problem for huge argument in coth git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4161 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcsch.c')
-rw-r--r--tests/tcsch.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tcsch.c b/tests/tcsch.c
index 172625488..271666518 100644
--- a/tests/tcsch.c
+++ b/tests/tcsch.c
@@ -75,6 +75,22 @@ check_specials (void)
exit (1);
}
+ /* check huge x */
+ mpfr_set_str (x, "8e8", 10, GMP_RNDN);
+ mpfr_csch (y, x, GMP_RNDN);
+ if (! (mpfr_zero_p (y) && MPFR_SIGN (y) > 0))
+ {
+ printf ("Error: csch(8e8) != +0\n");
+ exit (1);
+ }
+ mpfr_set_str (x, "-8e8", 10, GMP_RNDN);
+ mpfr_csch (y, x, GMP_RNDN);
+ if (! (mpfr_zero_p (y) && MPFR_SIGN (y) < 0))
+ {
+ printf ("Error: csch(-8e8) != -0\n");
+ exit (1);
+ }
+
mpfr_clear (x);
mpfr_clear (y);
}