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

API alignment + ERROR fix #82

Merged
merged 5 commits into from
Apr 26, 2021
Merged

API alignment + ERROR fix #82

merged 5 commits into from
Apr 26, 2021

Conversation

holiman
Copy link
Owner

@holiman holiman commented Apr 26, 2021

This PR does a couple of things

  • Aligns the API a bit more closely to big.Int. Primarily, by making NewInt(uint64) take an input parameter.
  • Changes AddOverflow(x, y *Int) bool -> AddOverflow(x, y *Int) (*Int, bool)
  • Changes SubOverflow(x, y *Int) bool -> SubOverflow(x, y *Int) (*Int, bool)
  • Adds AddUint64

Important This PR also fixes an error in SubUint64. Before this PR, if the receiver was not identical to the first argument, it would return wrong numbers in many cases, due to exiting early if the carry was zero.

@holiman holiman merged commit b323bdc into master Apr 26, 2021
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.

None yet

1 participant