Skip to content

Commit

Permalink
Fix argument order for endian and digits_order
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Sep 17, 2024
1 parent aa9c829 commit f36dbb9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gmpy2_convert_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ mpz_set_PyLong(mpz_t z, PyObject *obj)
static PyLong_DigitArray long_export;

PyLong_AsDigitArray(obj, &long_export);
mpz_import(z, long_export.ndigits, layout->endian,
layout->digit_size, layout->digits_order,
mpz_import(z, long_export.ndigits, layout->digits_order,
layout->digit_size, layout->endian,
layout->digit_size*8 - layout->bits_per_digit,
long_export.digits);
if (long_export.negative) {
Expand Down Expand Up @@ -142,8 +142,8 @@ GMPy_PyLong_From_MPZ(MPZ_Object *obj, CTXT_Object *context)
/* LCOV_EXCL_STOP */
}

mpz_export(digits, NULL, layout->endian,
layout->digit_size, layout->digits_order,
mpz_export(digits, NULL, layout->digits_order,
layout->digit_size, layout->endian,
layout->digit_size*8 - layout->bits_per_digit,
obj->z);

Expand Down

0 comments on commit f36dbb9

Please sign in to comment.