summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-09-12 13:29:44 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-09-12 13:29:44 +0000
commitb8baa576a25ed81b3e25cb4d47c55db3ff81dbc5 (patch)
treecbbc6d73e8b1d4c2ddc24f78a2dd5fb4af78ed02
parent35bf4379232f6d47b4f1a32dde61edc4bf1d1a38 (diff)
downloadmpfr-b8baa576a25ed81b3e25cb4d47c55db3ff81dbc5.tar.gz
tests/tpow_z.c: fixed bug20080904. [svn merge -c5623 .../trunk]
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/2.3@5624 280ebfd0-de03-0410-8827-d642c229c3f4
-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 d3d91d30b..b78109f97 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);