-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add checked math to FixedDecimals; default to overflow behavior #85
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c81bb83
Let all the FixedDecimals operations overflow, matching Int overflow
NHDaly 9da03cd
Add checked_* methods for FixedDecimals
NHDaly f19c147
Fix dispatch for checked_mul and checked_div. Fix checked_div
NHDaly ea46f72
Add checked `/` operation for FDs: `checked_decimal_division`
NHDaly c465e6f
Add README sections around overflow, conversions and inexact errors
NHDaly fc1d927
Add the missing checked_ operations: fld,cld,rem,mod,abs,neg. Add tests
NHDaly e134ee4
Fix up tests
NHDaly 2efb468
Add corner cases tests
NHDaly 7793ffc
Fix OverflowError for older versions of julia
NHDaly 30aef4f
Add fld/cld tests, but they still seem wrong, and abs/neg
NHDaly 07bf40f
Change overflow tests to FD{Int8,1} to make the results easier to thi…
NHDaly 137c8b4
Add promotions tests
NHDaly e1dd56d
Rename checked_rdiv; reexport checked*
NHDaly d119dce
Enable nightly CI
NHDaly 41a69fd
Apply suggestions from code review
NHDaly 3270ad5
Improve perf: don't force-promote inside *()
NHDaly 4cb2d5d
Make division operations always throw on overflow!
NHDaly 0cf9092
Add overflow tests for fld1 and div(::RoundMode)
NHDaly 8eefc80
Cleanup
NHDaly 34a9306
This is a breaking release!
NHDaly 73410da
compat to README
NHDaly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
version: | ||
- '1.6' | ||
- '1' | ||
# - 'nightly' | ||
- 'nightly' | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Also here would be good to audit if
promote
is a good idea when one of the inputs is aBigInt
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.
Currently, I think that this package just relies on promotion to do arithmetic on BigInts, which I agree is causing unnecessary allocs:
I'm just going to file this as a future improvement and move on, since I feel bad about how long this PR has lagged for.
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.
Filed: #87.