diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-26 16:59:08 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 44da4f66c1385aeb9eaa24591a95ed7d3a90b146 (patch) | |
tree | b6abd29040b46cac2a7cd0cc495ccc685e1c097d | |
parent | 18d0137e06783db5e331a87f198fd2133eb0d797 (diff) | |
download | dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.tar dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.tar.gz dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.tar.bz2 dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.tar.lz dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.tar.xz dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.tar.zst dexon-44da4f66c1385aeb9eaa24591a95ed7d3a90b146.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 499e066f7..3a82190da 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) } } |