Skip to content
Snippets Groups Projects
Commit 2adf7ec3 authored by Damien George's avatar Damien George
Browse files

py/mpz: Fix conversion of float to mpz so it works on big endian archs.

parent b1fa907d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment