Skip to content

Commit

Permalink
Don't reset leading digits in GMPy_PyLong_From_MPZ()
Browse files Browse the repository at this point in the history
count should be equal to size
  • Loading branch information
skirpichev committed Jun 13, 2024
1 parent b1e684d commit a3c4175
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/gmpy2_convert_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ GMPy_PyLong_From_MPZ(MPZ_Object *obj, CTXT_Object *context)
mpz_export(GET_OB_DIGIT(result), &count, -1, sizeof(digit), 0,
sizeof(digit)*8 - PyLong_SHIFT, obj->z);

for (size_t i = count; i < size; i++) {
GET_OB_DIGIT(result)[i] = 0;
}
_PyLong_SetSignAndDigitCount(result, mpz_sgn(obj->z) < 0, count);

return (PyObject*)result;
Expand Down

0 comments on commit a3c4175

Please sign in to comment.