diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-26 16:59:08 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 476be9391b3e68afd7f60d72d53424176ccb5c07 (patch) | |
tree | a64fcdec61ae7e3edf5cf4d219f62c1ba41c7f3b | |
parent | 4fc432d83179e85489944b454b7dad9cbbf8ab0a (diff) | |
download | dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.tar dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.tar.gz dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.tar.bz2 dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.tar.lz dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.tar.xz dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.tar.zst dexon-476be9391b3e68afd7f60d72d53424176ccb5c07.zip |
core: vm: fix power2 table calculation (#50)
-rw-r--r-- | core/vm/instructions.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 342124882..beb4c6b73 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -43,10 +43,10 @@ var ( ) func init() { - cur := int64(1) + cur := big.NewInt(1) for i := 0; i < 256; i++ { - power2[i] = big.NewInt(cur) - cur <<= 1 + power2[i] = new(big.Int).Set(cur) + cur = new(big.Int).Mul(cur, big2) } } |