Skip to content

Commit f66ee4d

Browse files
committed
py/mpz.c: Fix bug with shl not truncating zero digits correctly.
1 parent 8f6aad2 commit f66ee4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/mpz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ STATIC mp_uint_t mpn_shl(mpz_dig_t *idig, mpz_dig_t *jdig, mp_uint_t jlen, mp_ui
9797

9898
// work out length of result
9999
jlen += n_whole;
100-
if (idig[jlen - 1] == 0) {
100+
while (jlen != 0 && idig[jlen - 1] == 0) {
101101
jlen--;
102102
}
103103

0 commit comments

Comments
 (0)