summaryrefslogtreecommitdiff
path: root/tests/texp.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-06-21 11:30:38 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-06-21 11:30:38 +0000
commitc66cd67774bd8ffce2b0343d5fe57ddd3018398f (patch)
treea4d22d5ff28f1295608dc42d091cb54a2cc3d961 /tests/texp.c
parent2602be9b84a6a294ea415165f2f8329175722699 (diff)
downloadmpfr-c66cd67774bd8ffce2b0343d5fe57ddd3018398f.tar.gz
Tests: when restoring the exponent range, save emin/emax first instead
of using MPFR_EMIN_MIN/MPFR_EMAX_MAX (which have no longer corresponded to the default exponent range since quite a long time). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4555 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/texp.c')
-rw-r--r--tests/texp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/texp.c b/tests/texp.c
index a7b0c92e4..1e9786500 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -221,6 +221,9 @@ check_special ()
mpfr_t x, y, z;
mp_exp_t emin, emax;
+ emin = mpfr_get_emin ();
+ emax = mpfr_get_emax ();
+
mpfr_init (x);
mpfr_init (y);
mpfr_init (z);
@@ -319,7 +322,6 @@ check_special ()
}
/* check overflow */
- emax = mpfr_get_emax ();
set_emax (10);
mpfr_set_ui (x, 7, GMP_RNDN);
test_exp (y, x, GMP_RNDN);
@@ -331,7 +333,6 @@ check_special ()
set_emax (emax);
/* check underflow */
- emin = mpfr_get_emin ();
set_emin (-10);
mpfr_set_si (x, -9, GMP_RNDN);
test_exp (y, x, GMP_RNDN);
@@ -419,8 +420,8 @@ check_special ()
exit (1);
}
- set_emin (MPFR_EMIN_MIN);
- set_emax (MPFR_EMAX_MAX);
+ set_emin (emin);
+ set_emax (emax);
/* Check for overflow producing a segfault with HUGE exponent */
mpfr_set_ui (x, 3, GMP_RNDN);