summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/modulo.py
blob: c95305d13d9c95e5ac2b212f12c9c843fd5972d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# check modulo matches python definition

# this tests compiler constant folding
print(123 % 7)
print(-123 % 7)
print(123 % -7)
print(-123 % -7)

a = 321
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)


a = 987654321987987987987987987987
b = 19

print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)