diff --git a/py/mpz.c b/py/mpz.c index 2a4fb4659d..b3f8b15b60 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -711,7 +711,11 @@ typedef uint32_t mp_float_int_t; #endif union { mp_float_t f; + #if MP_ENDIANNESS_LITTLE struct { mp_float_int_t frc:MP_FLOAT_FRAC_BITS, exp:MP_FLOAT_EXP_BITS, sgn:1; } p; + #else + struct { mp_float_int_t sgn:1, exp:MP_FLOAT_EXP_BITS, frc:MP_FLOAT_FRAC_BITS; } p; + #endif } u = {src}; z->neg = u.p.sgn;