2014-09-29 14:40:20 -04:00
|
|
|
# test comparison operators
|
|
|
|
@micropython.viper
|
2020-03-22 22:26:08 -04:00
|
|
|
def f(x: int, y: int):
|
2014-09-29 14:40:20 -04:00
|
|
|
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)
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2014-09-29 14:40:20 -04:00
|
|
|
f(1, 1)
|
|
|
|
f(2, 1)
|
|
|
|
f(1, 2)
|
|
|
|
f(2, -1)
|
|
|
|
f(-2, 1)
|