circuitpython/tests/micropython/viper_binop_comp.py
Scott Shawcroft b057fb8a4b
codeformat
2021-04-19 22:22:44 -07:00

23 lines
356 B
Python

# 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)