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

Fix bug in previous PR for comparisons that underflow (large negatives) #89

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Dec 20, 2023

In these cases, we were previously returning the wrong result. 😓

julia> @test typemin(Int8) < FD{Int8, 2}(-1) < typemax(Int8)
Test Failed at REPL[27]:1
  Expression: typemin(Int8) < FD{Int8, 2}(-1) < typemax(Int8)
   Evaluated: -128 < FixedDecimal{Int8,2}(-1.00) < 127

julia> @test typemin(FD{Int8, 1}) < typemin(FD{Int8,2})
Test Failed at REPL[34]:1
  Expression: typemin(FD{Int8, 1}) < typemin(FD{Int8, 2})
   Evaluated: FixedDecimal{Int8,1}(-12.8) < FixedDecimal{Int8,2}(-1.28)

Now those tests pass.

@NHDaly NHDaly added the bug label Dec 20, 2023
Copy link

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

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

thank you!!

@NHDaly NHDaly force-pushed the nhd-comparisons-negatives-underflow-bug branch from c2e20c5 to a7e5037 Compare December 20, 2023 22:04
@NHDaly NHDaly merged commit ddee978 into master Dec 20, 2023
14 checks passed
@NHDaly NHDaly deleted the nhd-comparisons-negatives-underflow-bug branch December 20, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants