summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/fits_u.h')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_u.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_u.h b/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
index e84c6b6560b..1faabf48314 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
@@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
int
FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd)
{
- unsigned int saved_flags;
+ mpfr_flags_t saved_flags;
mpfr_exp_t e;
int prec;
TYPE s;
@@ -65,7 +65,8 @@ FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd)
/* hard case: first round to prec bits, then check */
saved_flags = __gmpfr_flags;
mpfr_init2 (x, prec);
- mpfr_set (x, f, rnd);
+ /* For MPFR_RNDF, if f > 0 fits with RNDU, it will also fit with RNDD. */
+ mpfr_set (x, f, (rnd != MPFR_RNDF) ? rnd : MPFR_RNDU);
/* Warning! Due to the rounding, x can be an infinity. Here we use
the fact that singular numbers have a special exponent field,
thus well-defined and different from e, in which case this means