-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
6 changed files
with
87 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,4 @@ func udivrem2by1(uh, ul, d, reciprocal uint64) (quot, rem uint64) { | |
} | ||
|
||
return qh, r | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters