From 7d2a8dd65ca2f7986877ef8fd4ef24e1c600a059 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Tue, 28 Aug 2007 13:49:02 +0000 Subject: 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 --- tests/tatan.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/tatan.c') 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); -- cgit v1.2.1