Commit 89172b6d authored by Stefan Behnel's avatar Stefan Behnel

Add a test for inferred integer %-operations.

parent a1a2bd70
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment