diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-22 02:38:43 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-22 02:38:43 +0800 |
commit | 20ee1ae65e57ef7d60404277162c84c572c6bb10 (patch) | |
tree | dbb43cc384068a98650b035d9f8a157e9de263f9 /ethutil/big.go | |
parent | eab0b2a90a3e33d0be4d09cbb99d193ba2219844 (diff) | |
download | dexon-20ee1ae65e57ef7d60404277162c84c572c6bb10.tar.gz dexon-20ee1ae65e57ef7d60404277162c84c572c6bb10.tar.zst dexon-20ee1ae65e57ef7d60404277162c84c572c6bb10.zip |
Refactored CALLDATALOAD to use big int
* Added BigMin
Diffstat (limited to 'ethutil/big.go')
-rw-r--r-- | ethutil/big.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ethutil/big.go b/ethutil/big.go index 7af6f7414..ec263b818 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -4,14 +4,6 @@ import ( "math/big" ) -var BigInt0 *big.Int = big.NewInt(0) - -// True -var BigTrue *big.Int = big.NewInt(1) - -// False -var BigFalse *big.Int = big.NewInt(0) - // Big pow // // Returns the power of two big integers @@ -73,3 +65,14 @@ func BigMax(x, y *big.Int) *big.Int { return x } + +// Big min +// +// Returns the minimum size big integer +func BigMin(x, y *big.Int) *big.Int { + if x.Cmp(y) >= 0 { + return y + } + + return x +} |