Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
da3dffa7
Commit
da3dffa7
authored
Jan 08, 2016
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py/objint: Fix classification of float so it works for OBJ_REPR_D.
parent
2adf7ec3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
py/objint.c
py/objint.c
+3
-1
No files found.
py/objint.c
View file @
da3dffa7
...
...
@@ -107,7 +107,9 @@ mp_fp_as_int_class_t mp_classify_fp_as_int(mp_float_t val) {
}
else
{
e
&=
~
((
1
<<
MP_FLOAT_EXP_SHIFT_I32
)
-
1
);
}
if
(
e
<=
((
BITS_PER_WORD
+
MP_FLOAT_EXP_BIAS
-
3
)
<<
MP_FLOAT_EXP_SHIFT_I32
))
{
// 8 * sizeof(uintptr_t) counts the number of bits for a small int
// TODO provide a way to configure this properly
if
(
e
<=
((
8
*
sizeof
(
uintptr_t
)
+
MP_FLOAT_EXP_BIAS
-
3
)
<<
MP_FLOAT_EXP_SHIFT_I32
))
{
return
MP_FP_CLASS_FIT_SMALLINT
;
}
#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_LONGLONG
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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