aboutsummaryrefslogtreecommitdiffstats
path: root/mobile
diff options
context:
space:
mode:
authorAlejandro Isaza <alejandro.isaza@gmail.com>2017-12-10 06:45:46 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-10 06:45:46 +0800
commitbbfe0b8d040728b4f6a40de0480301b4b5f3c9e2 (patch)
tree8b3f685aaa9f6065f775bd13981a33c8f4eb52fd /mobile
parent46e5583993afe7b9d0ff432f846b2a97bcb89876 (diff)
downloadgo-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.tar
go-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.tar.gz
go-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.tar.bz2
go-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.tar.lz
go-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.tar.xz
go-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.tar.zst
go-tangerine-bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2.zip
mobile: Add GetSign to BigInt (#15558)
Diffstat (limited to 'mobile')
-rw-r--r--mobile/big.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/mobile/big.go b/mobile/big.go
index 564fbad47..dd7b15878 100644
--- a/mobile/big.go
+++ b/mobile/big.go
@@ -62,6 +62,16 @@ func (bi *BigInt) SetInt64(x int64) {
bi.bigint.SetInt64(x)
}
+// Sign returns:
+//
+// -1 if x < 0
+// 0 if x == 0
+// +1 if x > 0
+//
+func (bi *BigInt) Sign() int {
+ return bi.bigint.Sign()
+}
+
// SetString sets the big int to x.
//
// The string prefix determines the actual conversion base. A prefix of "0x" or