summaryrefslogtreecommitdiff
path: root/tests/micropython/viper_binop_divmod.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/viper_binop_divmod.py')
-rw-r--r--tests/micropython/viper_binop_divmod.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/micropython/viper_binop_divmod.py b/tests/micropython/viper_binop_divmod.py
index 822424982..4b74b527d 100644
--- a/tests/micropython/viper_binop_divmod.py
+++ b/tests/micropython/viper_binop_divmod.py
@@ -1,16 +1,20 @@
# test floor-division and modulo operators
+
@micropython.viper
-def div(x:int, y:int) -> int:
+def div(x: int, y: int) -> int:
return x // y
+
@micropython.viper
-def mod(x:int, y:int) -> int:
+def mod(x: int, y: int) -> int:
return x % y
+
def dm(x, y):
print(div(x, y), mod(x, y))
+
for x in (-6, 6):
for y in range(-7, 8):
if y == 0: