mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
vm: use truncated division in MOD
Mimic C#'s `%` behavior.
Related 4b44190
(#773).
This commit is contained in:
parent
c0b5271386
commit
0023c4f1f6
2 changed files with 17 additions and 9 deletions
|
@ -794,7 +794,7 @@ func (v *VM) execute(ctx *Context, op opcode.Opcode, parameter []byte) (err erro
|
|||
a := v.estack.Pop().BigInt()
|
||||
v.checkBigIntSize(a)
|
||||
|
||||
v.estack.PushVal(new(big.Int).Mod(a, b))
|
||||
v.estack.PushVal(new(big.Int).Rem(a, b))
|
||||
|
||||
case opcode.SHL, opcode.SHR:
|
||||
b := v.estack.Pop().BigInt().Int64()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue