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 special case comparisons of Decimal with NaN/Inf #31

Merged
merged 1 commit into from Apr 22, 2019

Conversation

Keno
Copy link
Contributor

@Keno Keno commented Apr 20, 2019

Inf is a common starting value for min comparisons (and similarly
for -Inf and max). As an example Plots.jl uses it to figure out
the extrema of values to be plotted. Since Inf is not representable
in Decimal, these comparisons were throwing an error. Fix this by
adding special case comparisons with AbstractFloat that behave properly
for the Inf case.

@Keno Keno requested a review from ararslan April 20, 2019 23:44
@coveralls
Copy link

coveralls commented Apr 20, 2019

Pull Request Test Coverage Report for Build 94

  • 9 of 13 (69.23%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-2.5%) to 92.079%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/equals.jl 9 13 69.23%
Totals Coverage Status
Change from base Build 91: -2.5%
Covered Lines: 93
Relevant Lines: 101

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 94

  • 9 of 13 (69.23%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-2.5%) to 92.079%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/equals.jl 9 13 69.23%
Totals Coverage Status
Change from base Build 91: -2.5%
Covered Lines: 93
Relevant Lines: 101

💛 - Coveralls

@coveralls
Copy link

coveralls commented Apr 20, 2019

Pull Request Test Coverage Report for Build 96

  • 13 of 13 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.5%) to 96.04%

Totals Coverage Status
Change from base Build 91: 1.5%
Covered Lines: 97
Relevant Lines: 101

💛 - Coveralls

`Inf` is a common starting value for `min` comparisons (and similarly
for `-Inf` and max). As an example Plots.jl uses it to figure out
the extrema of values to be plotted. Since Inf is not representable
in Decimal, these comparisons were throwing an error. Fix this by
adding special case comparisons with AbstractFloat that behave properly
for the Inf case.
Copy link
Member

@ararslan ararslan left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

@ararslan ararslan merged commit 450c43d into master Apr 22, 2019
@ararslan ararslan deleted the kf/naninfcomp branch April 22, 2019 18:11
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

3 participants