diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-10-14 11:49:06 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-10-14 11:49:06 +0000 |
commit | 1fa2277c10582baa8b8402b8cf1702116ccbc560 (patch) | |
tree | 672209195ecad922dc489260098588b4dca469ad /ui_pow_ui.c | |
parent | 51aef80e83eaf2fc76dd6be59c0549e890dccd2b (diff) | |
download | mpfr-1fa2277c10582baa8b8402b8cf1702116ccbc560.tar.gz |
replaced mpfr_can_round (approx, err, rnd1, GMP_RNDN, prec)
by mpfr_can_round (approx, err, rnd1, GMP_RNDZ, prec + 1)
which in addition guarantees a correct inexact flag
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2492 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'ui_pow_ui.c')
-rw-r--r-- | ui_pow_ui.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui_pow_ui.c b/ui_pow_ui.c index b8a512fb4..c8954e927 100644 --- a/ui_pow_ui.c +++ b/ui_pow_ui.c @@ -72,8 +72,8 @@ mpfr_ui_pow_ui (mpfr_ptr x, unsigned long int y, unsigned long int n, if (err < 0) err = 0; } - while (inexact && (mpfr_can_round (res, err, - MPFR_SIGN(res) > 0 ? GMP_RNDU : GMP_RNDD, rnd, MPFR_PREC(x)) == 0)); + while (inexact && !mpfr_can_round (res, err, GMP_RNDN, GMP_RNDZ, + MPFR_PREC(x) + (rnd == GMP_RNDN))); if (mpfr_set (x, res, rnd)) inexact = 1; |