summaryrefslogtreecommitdiff
path: root/src/powerof2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/powerof2.c')
-rw-r--r--src/powerof2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/powerof2.c b/src/powerof2.c
index f10ace0ad..53f0551cd 100644
--- a/src/powerof2.c
+++ b/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)