Skip to content
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

Merged
merged 1 commit into from
Dec 9, 2017
Merged

mobile: Add GetSign to mobile BigInt #15558

merged 1 commit into from
Dec 9, 2017

Conversation

alejandro-isaza
Copy link
Contributor

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.

@GitCop
Copy link

GitCop commented Nov 26, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 503844e08d5de2d290f1c792687e2c97ea1b2006
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@alejandro-isaza alejandro-isaza changed the title Add GetSign to mobile BigInt mobile: Add GetSign to mobile BigInt Nov 26, 2017
@alejandro-isaza
Copy link
Contributor Author

@karalabe ping

Copy link
Contributor

@holiman holiman left a 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 {
Copy link
Contributor

@holiman holiman Dec 4, 2017

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()
}

@GitCop
Copy link

GitCop commented Dec 5, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 503844e08d5de2d290f1c792687e2c97ea1b2006

  • Commits must be prefixed with the package(s) they modify

  • Commit: efb75b26adade096ea746e2829561bdd359f46b7

  • Commits must be prefixed with the package(s) they modify

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.
@alejandro-isaza
Copy link
Contributor Author

Done

@fjl fjl merged commit bbfe0b8 into ethereum:master Dec 9, 2017
@alejandro-isaza alejandro-isaza deleted the mobile-get-sign branch December 10, 2017 01:40
@karalabe karalabe added this to the 1.8.0 milestone Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants