summaryrefslogtreecommitdiff
path: root/tests/micropython/viper_binop_comp.py
blob: dcf91ed89db2fbbd5c2f1c0562eb24b264023fa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# test comparison operators
@micropython.viper
def f(x:int, y:int):
    if x < y:
        print(x, "<", y)
    if x > y:
        print(x, ">", y)
    if x == y:
        print(x, "==", y)
    if x <= y:
        print(x, "<=", y)
    if x >= y:
        print(x, ">=", y)
    if x != y:
        print(x, "!=", y)

f(1, 1)
f(2, 1)
f(1, 2)
f(2, -1)
f(-2, 1)