diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-01-19 05:10:16 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-01-19 05:10:16 +0000 |
commit | 62214bf0dec9074871051f6864b56d3199a9975a (patch) | |
tree | c5ff84e903c4ba7774fac24cd7bfc6c4f8cfaad3 /tests/tpow.c | |
parent | f661d476d453c69772e03cdc78260c3548340726 (diff) | |
download | mpfr-62214bf0dec9074871051f6864b56d3199a9975a.tar.gz |
tests/tpow.c: added tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4339 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow.c')
-rw-r--r-- | tests/tpow.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/tpow.c b/tests/tpow.c index 3cf11cdd0..c268f6bba 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -275,6 +275,28 @@ check_pow_si (void) mpfr_pow_si (x, x, -2, GMP_RNDN); MPFR_ASSERTN(mpfr_inf_p (x) && mpfr_sgn (x) > 0); + mpfr_set_si (x, 2, GMP_RNDN); + mpfr_pow_si (x, x, LONG_MAX, GMP_RNDN); + if (LONG_MAX > mpfr_get_emax () - 1) + { + MPFR_ASSERTN (mpfr_inf_p (x)); + } + else + { + MPFR_ASSERTN (mpfr_cmp_si_2exp (x, 2, LONG_MAX)); + } + + mpfr_set_si (x, 2, GMP_RNDN); + mpfr_pow_si (x, x, LONG_MIN, GMP_RNDN); + if (LONG_MIN + 1 < mpfr_get_emin ()) + { + MPFR_ASSERTN (mpfr_zero_p (x)); + } + else + { + MPFR_ASSERTN (mpfr_cmp_si_2exp (x, 2, LONG_MIN)); + } + mpfr_clear (x); } |