summaryrefslogtreecommitdiff
path: root/tests/tcos.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/tcos.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/tcos.c')
-rw-r--r--tests/tcos.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/tcos.c b/tests/tcos.c
index 967b4cdf3..f485f37a1 100644
--- a/tests/tcos.c
+++ b/tests/tcos.c
@@ -140,6 +140,10 @@ static void
special_overflow (void)
{
mpfr_t x, y;
+ mp_exp_t emin, emax;
+
+ emin = mpfr_get_emin ();
+ emax = mpfr_get_emax ();
mpfr_init2 (x, 24);
mpfr_init2 (y, 73);
@@ -149,8 +153,8 @@ special_overflow (void)
set_emax (128);
mpfr_set_str_binary (x, "0.111101010110110011101101E6");
test_cos (y, x, GMP_RNDZ);
- set_emin (MPFR_EMIN_MIN);
- set_emax (MPFR_EMAX_MAX);
+ set_emin (emin);
+ set_emax (emax);
mpfr_clear (x);
mpfr_clear (y);
@@ -161,6 +165,9 @@ overflowed_cos0 (void)
{
mpfr_t x, y;
int emax, i, inex, rnd, err = 0;
+ mp_exp_t old_emax;
+
+ old_emax = mpfr_get_emax ();
mpfr_init2 (x, 8);
mpfr_init2 (y, 8);
@@ -224,7 +231,7 @@ overflowed_cos0 (void)
}
}
}
- set_emax (MPFR_EMAX_MAX);
+ set_emax (old_emax);
}
if (err)