fix operators containing percent for VM usage (#13536)
* fixes #13513 * merge tarithmetics in tarithm
This commit is contained in:
parent
e64f1c7ee4
commit
2f557652d4
11 changed files with 165 additions and 137 deletions
|
|
@ -12,7 +12,9 @@ int32
|
|||
4294967295
|
||||
2
|
||||
0
|
||||
tUnsignedOps OK
|
||||
'''
|
||||
nimout: "tUnsignedOps OK"
|
||||
"""
|
||||
|
||||
import typetraits
|
||||
|
|
@ -167,3 +169,19 @@ block tissue12177:
|
|||
echo(a - b)
|
||||
echo(a * b)
|
||||
echo(a div b)
|
||||
|
||||
block tUnsignedOps:
|
||||
proc testUnsignedOps() =
|
||||
let a: int8 = -128
|
||||
let b: int8 = 127
|
||||
|
||||
doAssert b +% 1 == -128
|
||||
doAssert b -% -1 == -128
|
||||
doAssert b *% 2 == -2
|
||||
doAssert a /% 4 == 32
|
||||
doAssert a %% 7 == 2
|
||||
echo "tUnsignedOps OK"
|
||||
|
||||
testUnsignedOps()
|
||||
static:
|
||||
testUnsignedOps()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue