circuitpython/tests/micropython/viper_binop_comp.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
356 B
Python
Raw Normal View History

# test comparison operators
@micropython.viper
2021-03-15 09:57:36 -04:00
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)
2021-03-15 09:57:36 -04:00
f(1, 1)
f(2, 1)
f(1, 2)
f(2, -1)
f(-2, 1)