diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-26 16:59:08 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:49:58 +0800 |
commit | 3936e9c4d51626afd9b61ff184cf16dbbb4dd89e (patch) | |
tree | c1793bfb07af535da337a0bcbc118be9e3f0c331 | |
parent | 3989dc26529dc442c747d4f101d4b6c6d215def1 (diff) | |
download | dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.tar dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.tar.gz dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.tar.bz2 dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.tar.lz dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.tar.xz dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.tar.zst dexon-3936e9c4d51626afd9b61ff184cf16dbbb4dd89e.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) } } |