diff options
Diffstat (limited to 'fits_uintmax.c')
-rw-r--r-- | fits_uintmax.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fits_uintmax.c b/fits_uintmax.c index caa9b1ab4..c1d0b64be 100644 --- a/fits_uintmax.c +++ b/fits_uintmax.c @@ -53,12 +53,12 @@ mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd) mpfr_t x; int res; - if (MPFR_IS_NAN(f) || MPFR_IS_INF(f) || MPFR_SIGN(f) < 0) - return 0; /* does not fit */ - - if (MPFR_IS_ZERO(f)) - return 1; /* zero always fits */ - + if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f))) + /* Zero always fit */ + return MPFR_IS_ZERO (f) ? 1 : 0; + else if (MPFR_IS_NEG (f)) + /* Negative numbers doesn't fit */ + return 0; /* now it fits if (a) f <= MAXIMUM (b) round(f, prec(slong), rnd) <= MAXIMUM */ |