diff options
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/powerof2.c')
-rw-r--r-- | Build/source/libs/mpfr/mpfr-src/src/powerof2.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/powerof2.c b/Build/source/libs/mpfr/mpfr-src/src/powerof2.c index f10ace0ad03..53f0551cd66 100644 --- a/Build/source/libs/mpfr/mpfr-src/src/powerof2.c +++ b/Build/source/libs/mpfr/mpfr-src/src/powerof2.c @@ -31,16 +31,17 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_powerof2_raw (mpfr_srcptr x) { - mp_limb_t *xp; - mp_size_t xn; - /* This is an internal function, and we may call it with some wrong numbers (ie good mantissa but wrong flags or exp) So we don't want to test if it is a pure FP. MPFR_ASSERTN(MPFR_IS_PURE_FP(x)); */ - xp = MPFR_MANT(x); - xn = (MPFR_PREC(x) - 1) / GMP_NUMB_BITS; - if (xp[xn] != MPFR_LIMB_HIGHBIT) + return mpfr_powerof2_raw2 (MPFR_MANT(x), MPFR_LIMB_SIZE(x)); +} + +int +mpfr_powerof2_raw2 (const mp_limb_t *xp, mp_size_t xn) +{ + if (xp[--xn] != MPFR_LIMB_HIGHBIT) return 0; while (xn > 0) if (xp[--xn] != 0) |