Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uPython-mirror
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
uPython-mirror
Commits
7445997c
Commit
7445997c
authored
Feb 19, 2018
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py/objint_mpz: Adjust check for zero RHS of int div to help Polyspace.
parent
c41587fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
py/objint_mpz.c
py/objint_mpz.c
+4
-3
No files found.
py/objint_mpz.c
View file @
7445997c
...
...
@@ -199,11 +199,12 @@ mp_obj_t mp_obj_int_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i
if
(
0
)
{
#if MICROPY_PY_BUILTINS_FLOAT
}
else
if
(
op
==
MP_BINARY_OP_TRUE_DIVIDE
||
op
==
MP_BINARY_OP_INPLACE_TRUE_DIVIDE
)
{
if
(
mpz_is_zero
(
zrhs
))
{
goto
zero_division_error
;
}
mp_float_t
flhs
=
mpz_as_float
(
zlhs
);
mp_float_t
frhs
=
mpz_as_float
(
zrhs
);
if
(
frhs
==
0
)
{
// We check the float val and call mp_raise_msg here to help Polyspace
mp_raise_msg
(
&
mp_type_ZeroDivisionError
,
"division by zero"
);
}
return
mp_obj_new_float
(
flhs
/
frhs
);
#endif
...
...
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