Closed Slava0135 closed 2 weeks ago
Similar to #3598
For negative numbers operation returns wrong results (compared to C#).
(-1 ^ 3) % 3 == 2
C# results:
(-1 ^ 3) % 3 == -1
operation uses Go's Exp function that explicitly makes modulus result positive, which is different from BigInteger from C#
Exp
./bin/neo-go vm
loadbase64 DxMTpg==
run
Similar to #3598
Current Behavior
For negative numbers operation returns wrong results (compared to C#).
Expected Behavior
C# results:
Possible Solution
operation uses Go's
Exp
function that explicitly makes modulus result positive, which is different from BigInteger from C#Steps to Reproduce
./bin/neo-go vm
loadbase64 DxMTpg==
run
Your Environment