From bbfe0b8d040728b4f6a40de0480301b4b5f3c9e2 Mon Sep 17 00:00:00 2001 From: Alejandro Isaza Date: Sat, 9 Dec 2017 14:45:46 -0800 Subject: mobile: Add GetSign to BigInt (#15558) --- mobile/big.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mobile/big.go') 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 -- cgit v1.2.3