aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/big.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-31 00:03:20 +0800
committerzelig <viktor.tron@gmail.com>2014-07-31 00:03:20 +0800
commit9831619881c5264c2449ce1b906108d892b6e1e1 (patch)
treef8775b1196fe6b31081a553945377f40bdc8d550 /ethutil/big.go
parent194c58858cd230a9a08b0eb14650720341a5580e (diff)
parent42d47ecfb09ac0b419db5722602d9b02e21f2457 (diff)
downloaddexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.gz
dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.zst
dexon-9831619881c5264c2449ce1b906108d892b6e1e1.zip
merge upstream
Diffstat (limited to 'ethutil/big.go')
-rw-r--r--ethutil/big.go19
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
+}