summaryrefslogtreecommitdiff
path: root/tests/tpow.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-11-18 15:53:55 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-11-18 15:53:55 +0000
commit9edda957c6e35bceffa706a8ce0249f1308a6cf7 (patch)
tree55d8b76e908c637b4f1b1bea87e22e28fefba250 /tests/tpow.c
parent467b9a3f2bc980d551c3f9924bdda549b6905a39 (diff)
downloadmpfr-9edda957c6e35bceffa706a8ce0249f1308a6cf7.tar.gz
Fix an overflow bug.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3104 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow.c')
-rw-r--r--tests/tpow.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tpow.c b/tests/tpow.c
index c0017bf66..69f9b5aa8 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -132,6 +132,8 @@ static void
check_special_pow_si ()
{
mpfr_t a, b;
+ mp_exp_t emin;
+
mpfr_init (a);
mpfr_init (b);
mpfr_set_str (a, "2E100000000", 10, GMP_RNDN);
@@ -144,6 +146,19 @@ check_special_pow_si ()
mpfr_dump (b);
exit(1);
}
+
+ emin = mpfr_get_emin ();
+ mpfr_set_emin (-10);
+ mpfr_set_si (a, -2, GMP_RNDN);
+ mpfr_pow_si (b, a, -10000, GMP_RNDN);
+ if (!MPFR_IS_ZERO (b))
+ {
+ printf ("Pow_so (1, -10000) doesn't underflow if emin=-10.\n");
+ mpfr_dump (a);
+ mpfr_dump (b);
+ exit (1);
+ }
+ mpfr_set_emin (emin);
mpfr_clear (a);
mpfr_clear (b);
}