mobile: Add GetSign to BigInt (#15558)

This commit is contained in:
Alejandro Isaza 2017-12-09 14:45:46 -08:00 committed by Felix Lange
parent 46e5583993
commit bbfe0b8d04

View File

@ -62,6 +62,16 @@ func (bi *BigInt) SetInt64(x int64) {
bi.bigint.SetInt64(x) 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. // SetString sets the big int to x.
// //
// The string prefix determines the actual conversion base. A prefix of "0x" or // The string prefix determines the actual conversion base. A prefix of "0x" or