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

Add support for three-arg div to FixedDecimals in Julia 1.4+ #51

Merged
merged 4 commits into from
Feb 1, 2020

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Feb 1, 2020

This PR adds support for three-arg div by implementing div(x,y,::RoundingMode) for FixedDecimals that delegates to div of the fields.

Remaining question: Is this enough? Do we also need to implement the three-arg fld, mod, etc?

Fixes #50.

This commit simply implements `div(x,y,::RoundingMode)` for
FixedDecimals by delegating to `div` of the fields.
@NHDaly NHDaly requested review from TotalVerb and Keno February 1, 2020 18:07
@coveralls
Copy link

coveralls commented Feb 1, 2020

Coverage Status

Coverage increased (+2.2%) to 97.531% when pulling b32b8b9 on nhd-julia1.4--three-arg-div-support into c9c4686 on master.

Before:
```julia

julia> let FD2 = FixedDecimal{Int,2}
           cld(FD2(0.01), FD2(2))
       end
FixedDecimal{Int64,2}(0.00)
```
After:
```julia
julia> let FD2 = FixedDecimal{Int,2}
           cld(FD2(0.01), FD2(2))
       end
FixedDecimal{Int64,2}(1.00)
```
Copy link
Member Author

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, comments addressed, this should be good to go. :) Thanks!

Copy link
Collaborator

@TotalVerb TotalVerb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-io
Copy link

codecov-io commented Feb 1, 2020

Codecov Report

Merging #51 into master will increase coverage by 5.63%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   92.13%   97.76%   +5.63%     
==========================================
  Files           1        1              
  Lines         178      179       +1     
==========================================
+ Hits          164      175      +11     
+ Misses         14        4      -10
Impacted Files Coverage Δ
src/FixedPointDecimals.jl 97.76% <50%> (+5.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9c4686...b32b8b9. Read the comment docs.

@NHDaly NHDaly merged commit 8e80d39 into master Feb 1, 2020
@omus omus deleted the nhd-julia1.4--three-arg-div-support branch February 4, 2020 18:25
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.

Add support for rounding modes for division for FixedDecimals
4 participants