fix #16815 round(x,places) works again in vm (#16825)

* fix #16815 round+places works again in vm

* improve tests; fix for linux 32bit

* fix test for windows
This commit is contained in:
Timothee Cour 2021-01-28 01:40:18 -08:00 • committed by GitHub
commit b0f38a63c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 29 deletions

View file

@ -41,6 +41,9 @@ template getX(k, field) {.dirty.} =
doAssert a.slots[i+a.rb+1].kind == k
result = a.slots[i+a.rb+1].field
proc numArgs*(a: VmArgs): int =
result = a.rc-1
proc getInt*(a: VmArgs; i: Natural): BiggestInt = getX(rkInt, intVal)
proc getBool*(a: VmArgs; i: Natural): bool = getInt(a, i) != 0
proc getFloat*(a: VmArgs; i: Natural): BiggestFloat = getX(rkFloat, floatVal)