fix operators containing percent for VM usage (#13536)

* fixes #13513
* merge tarithmetics in tarithm
This commit is contained in:
Arne Döring 2020-03-11 01:01:25 +01:00 • committed by GitHub
commit 2f557652d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 165 additions and 137 deletions

View file

@ -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()