py/mpz: Fix conversion of float to mpz so it works on big endian archs.
This commit is contained in:
parent
b1fa907d56
commit
2adf7ec3dd
4
py/mpz.c
4
py/mpz.c
@ -711,7 +711,11 @@ typedef uint32_t mp_float_int_t;
|
|||||||
#endif
|
#endif
|
||||||
union {
|
union {
|
||||||
mp_float_t f;
|
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;
|
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};
|
} u = {src};
|
||||||
|
|
||||||
z->neg = u.p.sgn;
|
z->neg = u.p.sgn;
|
||||||
|
Loading…
Reference in New Issue
Block a user