summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/mpz.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpz.c b/py/mpz.c
index 47cbf5db4a..c0a3d4b0b4 100644
--- a/py/mpz.c
+++ b/py/mpz.c
@@ -747,10 +747,16 @@ typedef uint32_t mp_float_int_t;
z->dig[dig_ind++] = (frc << shft) & DIG_MASK;
frc >>= DIG_SIZE - shft;
}
+#if DIG_SIZE < (MP_FLOAT_FRAC_BITS + 1)
while (dig_ind != dig_cnt) {
z->dig[dig_ind++] = frc & DIG_MASK;
frc >>= DIG_SIZE;
}
+#else
+ if (dig_ind != dig_cnt) {
+ z->dig[dig_ind] = frc;
+ }
+#endif
}
}
}