Skip to content

Commit

Permalink
mobile: Add GetSign to BigInt (#15558)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-isaza authored and fjl committed Dec 9, 2017
1 parent 46e5583 commit bbfe0b8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mobile/big.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbfe0b8

Please sign in to comment.