We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6995ee commit e9f1913Copy full SHA for e9f1913
tests/arithm/tarithm.nim
@@ -12,7 +12,9 @@ int32
12
4294967295
13
2
14
0
15
+tUnsignedOps OK
16
'''
17
+nimout: "tUnsignedOps OK"
18
"""
19
20
import typetraits
@@ -167,3 +169,19 @@ block tissue12177:
167
169
echo(a - b)
168
170
echo(a * b)
171
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
tests/system/tarithmetics.nim
0 commit comments