arturo
arturo copied to clipboard
[VM/values/operators] [`>>`] Verify for Web builds
[VM/values/operators] [>>
] Verify for Web builds
we should also check whether big integers work too!
(the same applies to its in-place equivalent)
https://github.com/arturo-lang/arturo/blob/04e57a1a8d6bcaf8fdb4003e0893ca35cc4ee90e/src/vm/values/operators.nim#L1391
case pair:
of Integer || Integer : normalIntegerShlI(x, y.i)
of BigInteger || Integer : (when defined(GMP): shlI(x.bi, culong(y.i)))
else:
discard invalidOperation("shl")
# TODO(VM/values/operators) [`>>`] Verify for Web builds
# we should also check whether big integers work too!
# (the same applies to its in-place equivalent)
# labels: unit-test, web, :integer
proc `>>`*(x: Value, y: Value): Value =
## perform binary right-shift between given values and return the result
let pair = getValuePair()
case pair:
of Integer || Integer : return normalIntegerShr(x.i, y.i)
of BigInteger || Integer : (when defined(GMP): return newInteger(x.bi shr culong(y.i)))
else:
return invalidOperation("shr")
42ae89a1cfecb4e80a2b6dbf3c8fe1998103abdf