Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
89172b6d
Commit
89172b6d
authored
Apr 27, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for inferred integer %-operations.
parent
a1a2bd70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
tests/run/modop.pyx
tests/run/modop.pyx
+47
-0
No files found.
tests/run/modop.pyx
View file @
89172b6d
...
...
@@ -179,6 +179,53 @@ def mod_obj_17(int2):
return
int1
def
mod_int_17
(
int
int2
):
"""
>>> 0 % 17
0
>>> mod_int_17(0)
0
>>> 1 % 17
1
>>> mod_int_17(1)
1
>>> (-1) % 17
16
>>> mod_int_17(-1)
16
>>> 9 % 17
9
>>> mod_int_17(16)
16
>>> 17 % 17
0
>>> mod_int_17(17)
0
>>> (-17) % 17
0
>>> mod_int_17(-17)
0
>>> (-18) % 17
16
>>> mod_int_17(-18)
16
>>> 10002 % 17
6
>>> mod_int_17(10002)
6
>>> int((2**25) % 17)
2
>>> int(mod_int_17(2**25))
2
>>> int((-2**25) % 17)
15
>>> int(mod_int_17(-2**25))
15
"""
int1
=
int2
%
17
return
int1
def
mod_obj_m2
(
int2
):
"""
>>> 0 % -2
...
...
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