Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
2adf7ec3
Commit
2adf7ec3
authored
Jan 08, 2016
by
Damien George
Browse files
py/mpz: Fix conversion of float to mpz so it works on big endian archs.
parent
b1fa907d
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/mpz.c
View file @
2adf7ec3
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment