summaryrefslogtreecommitdiff
path: root/tests/tpow_z.c
diff options
context:
space:
mode:
authorthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2008-09-10 10:00:31 +0000
committerthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2008-09-10 10:00:31 +0000
commitbc34cd5c5d0ce98a48dc3208f29d2e8529c0ec2c (patch)
treeda72d722a19058c92794b628ae6de589c01b5d5a /tests/tpow_z.c
parent163a504e69d32e38605bb88607e9ba063a7ccf4a (diff)
downloadmpfr-bc34cd5c5d0ce98a48dc3208f29d2e8529c0ec2c.tar.gz
tests/tpow_z.c: Check test for bug20080904 with the minimum possible negative exponent so as not to underflow with (future) 128 bits machine.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5623 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow_z.c')
-rw-r--r--tests/tpow_z.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/tpow_z.c b/tests/tpow_z.c
index ae9266b43..917f3c4f7 100644
--- a/tests/tpow_z.c
+++ b/tests/tpow_z.c
@@ -323,24 +323,26 @@ bug20080904 (void)
{
mpz_t exp;
mpfr_t a, answer;
+ mp_exp_t emin_default;
mpz_init (exp);
mpfr_init2 (a, 70);
mpfr_init2 (answer, 70);
+ emin_default = mpfr_get_emin ();
+ mpfr_set_emin (MPFR_EMIN_MIN);
+
mpz_set_str (exp, "-4eb92f8c7b7bf81e", 16);
mpfr_set_str_binary (a, "1.110000101110100110100011111000011110111101000011111001111001010011100");
mpfr_pow_z (answer, a, exp, GMP_RNDN);
/* The correct result is near 2^(-2^62), so it underflows when
MPFR_EMIN_MIN > -2^62 (i.e. with 32 and 64 bits machines). */
- /* FIXME: the mpfr_set_str doesn't underflow ! */
- /* mpfr_set_str (a, "196357155785798743515p-4632850503556296886", 10,
- GMP_RNDN); */
- mpfr_set_ui (a, 0, GMP_RNDN); /* TODO:replace this line when mpfr_set_str
- is debugged */
+ mpfr_set_str (a, "AA500C0D7A69275DBp-4632850503556296886", 16, GMP_RNDN);
MPFR_ASSERTN(mpfr_cmp0 (answer, a) == 0);
+ mpfr_set_emin (emin_default);
+
mpz_clear (exp);
mpfr_clear (a);
mpfr_clear (answer);