-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mobile: Add GetSign to mobile BigInt #15558
Conversation
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
@karalabe ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but please rename
mobile/big.go
Outdated
@@ -62,6 +62,11 @@ func (bi *BigInt) SetInt64(x int64) { | |||
bi.bigint.SetInt64(x) | |||
} | |||
|
|||
// GetSign returns -1 if x is negative, 0 if x is 0, or 1 if x is positive. | |||
func (bi *BigInt) GetSign() int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just call it Sign()
, (and optionally reuse the parent docs):
// Sign returns:
//
// -1 if x < 0
// 0 if x == 0
// +1 if x > 0
//
func (bi *BigInt) Sign() int{
return bi.bigint.Sign()
}
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
Currently, the only way of getting the sign of a BigInt from mobile is coverting to string. This adds a Sign function to make conversion faster.
Done |
Currently, the only way of getting the sign of a BigInt from mobile is
coverting to string. This adds a GetSign function to make conversion
faster.