Skip to content

Commit e9f1913

Browse files
committed
merge tarithmetics in tarithm
1 parent c6995ee commit e9f1913

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

tests/arithm/tarithm.nim

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ int32
1212
4294967295
1313
2
1414
0
15+
tUnsignedOps OK
1516
'''
17+
nimout: "tUnsignedOps OK"
1618
"""
1719

1820
import typetraits
@@ -167,3 +169,19 @@ block tissue12177:
167169
echo(a - b)
168170
echo(a * b)
169171
echo(a div b)
172+
173+
block tUnsignedOps:
174+
proc testUnsignedOps() =
175+
let a: int8 = -128
176+
let b: int8 = 127
177+
178+
doAssert b +% 1 == -128
179+
doAssert b -% -1 == -128
180+
doAssert b *% 2 == -2
181+
doAssert a /% 4 == 32
182+
doAssert a %% 7 == 2
183+
echo "tUnsignedOps OK"
184+
185+
testUnsignedOps()
186+
static:
187+
testUnsignedOps()

tests/system/tarithmetics.nim

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)