Skip to content

Commit bbfe0b8

Browse files
alejandro-isazafjl
authored andcommitted
mobile: Add GetSign to BigInt (#15558)
1 parent 46e5583 commit bbfe0b8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎mobile/big.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ func (bi *BigInt) SetInt64(x int64) {
6262
bi.bigint.SetInt64(x)
6363
}
6464

65+
// Sign returns:
66+
//
67+
// -1 if x < 0
68+
// 0 if x == 0
69+
// +1 if x > 0
70+
//
71+
func (bi *BigInt) Sign() int {
72+
return bi.bigint.Sign()
73+
}
74+
6575
// SetString sets the big int to x.
6676
//
6777
// The string prefix determines the actual conversion base. A prefix of "0x" or

0 commit comments

Comments
 (0)