summaryrefslogtreecommitdiff
path: root/tests/micropython/viper_binop_comp.py
blob: a4c0809c85523602f069eaf05e41cb4c3138c7ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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)