summaryrefslogtreecommitdiff
path: root/tests/tatan.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-08-28 13:49:02 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-08-28 13:49:02 +0000
commit7d2a8dd65ca2f7986877ef8fd4ef24e1c600a059 (patch)
treed6705fd05e5f211012e21793d61bbf0c1bbc50a8 /tests/tatan.c
parent7b16504ba3fdc059bf602562206f19dfec3a3bab (diff)
downloadmpfr-7d2a8dd65ca2f7986877ef8fd4ef24e1c600a059.tar.gz
tatan.c: added a similar test, but with an exact division result.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4789 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tatan.c')
-rw-r--r--tests/tatan.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/tatan.c b/tests/tatan.c
index e8132bd75..9e4fdb3b5 100644
--- a/tests/tatan.c
+++ b/tests/tatan.c
@@ -371,18 +371,28 @@ smallvals_atan2 (void)
mpfr_atan2 (a, y, x, GMP_RNDU);
MPFR_ASSERTN (mpfr_zero_p (a) && MPFR_IS_NEG(a));
- /* From a bug reported by Christopher Creutzig on 2007-08-28.
- Segmentation fault or assertion failure due to an infinite Ziv loop. */
mpfr_set_prec (x, 8);
mpfr_set_prec (y, 8);
mpfr_set_prec (a, 8);
old_emin = mpfr_get_emin ();
mpfr_set_emin (MPFR_EMIN_MIN);
+
+ mpfr_set_si (y, 3, GMP_RNDN);
+ mpfr_set_exp (y, mpfr_get_emin ());
+ mpfr_set_str_binary (x, "1.1");
+ mpfr_atan2 (a, y, x, GMP_RNDU);
+ mpfr_set_si (y, 1, GMP_RNDN);
+ mpfr_set_exp (y, mpfr_get_emin ());
+ MPFR_ASSERTN (mpfr_equal_p (a, y));
+
+ /* From a bug reported by Christopher Creutzig on 2007-08-28.
+ Segmentation fault or assertion failure due to an infinite Ziv loop. */
mpfr_set_si (y, 1, GMP_RNDN);
mpfr_set_exp (y, mpfr_get_emin ());
mpfr_set_str_binary (x, "1.01");
mpfr_atan2 (a, y, x, GMP_RNDU);
MPFR_ASSERTN (mpfr_equal_p (a, y));
+
mpfr_set_emin (old_emin);
mpfr_clears (a, x, y, (void *) 0);