summaryrefslogtreecommitdiff
path: root/tests/tpow_all.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-02-26 15:47:06 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-02-26 15:47:06 +0000
commita65e31201a6b04c3a1ab547af1d0fb47524fa410 (patch)
tree7e1090f73abd46ee298839ba0d9a39f7f536830d /tests/tpow_all.c
parent59ca51a0136999a99f8f2403f87a9f00cd376b8b (diff)
downloadmpfr-a65e31201a6b04c3a1ab547af1d0fb47524fa410.tar.gz
added round to away (still experimental)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6030 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow_all.c')
-rw-r--r--tests/tpow_all.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/tpow_all.c b/tests/tpow_all.c
index 181671bd7..969e62929 100644
--- a/tests/tpow_all.c
+++ b/tests/tpow_all.c
@@ -586,7 +586,7 @@ underflow_up2 (void)
char sy[256];
mpfr_set_ui (z0, 0, GMP_RNDN);
- expected_inex = rnd == GMP_RNDN || rnd == GMP_RNDU ?
+ expected_inex = rnd == GMP_RNDN || rnd == GMP_RNDU || rnd == GMP_RNDA ?
(mpfr_nextabove (z0), 1) : -1;
sprintf (sy, "%lu", (unsigned long) n);
@@ -629,8 +629,8 @@ underflow_up3 (void)
mpfr_nextabove (x);
/* x = 2 + i * eps, y = emin - 2, x^y ~= 2^(emin - 2) */
- expected_inex = rnd == GMP_RNDU || (rnd == GMP_RNDN && i < 0) ?
- 1 : -1;
+ expected_inex = rnd == GMP_RNDU || rnd == GMP_RNDA
+ || (rnd == GMP_RNDN && i < 0) ? 1 : -1;
mpfr_set_ui (z0, 0, GMP_RNDN);
if (expected_inex > 0)
@@ -696,14 +696,20 @@ overflow_inv (void)
RND_LOOP (rnd)
{
int inf, overflow;
+ mp_rnd_t rnd2;
+
+ if (rnd == GMP_RNDA)
+ rnd2 = s < 0 ? GMP_RNDD : GMP_RNDU;
+ else
+ rnd2 = rnd;
overflow = t == 0 ||
((mp_rnd_t) rnd == GMP_RNDN && (precx > 10 || t == 1)) ||
- ((mp_rnd_t) rnd == (s < 0 ? GMP_RNDD : GMP_RNDU) &&
+ ((mp_rnd_t) rnd2 == (s < 0 ? GMP_RNDD : GMP_RNDU) &&
(precx > 10 || t <= 2));
inf = overflow &&
((mp_rnd_t) rnd == GMP_RNDN ||
- (mp_rnd_t) rnd == (s < 0 ? GMP_RNDD : GMP_RNDU));
+ (mp_rnd_t) rnd2 == (s < 0 ? GMP_RNDD : GMP_RNDU));
mpfr_clear_flags ();
inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd);
if (overflow ^ !! mpfr_overflow_p ())