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

Commonize promotion rules #207

Merged
merged 1 commit into from
Aug 6, 2020
Merged

Conversation

kimikage
Copy link
Collaborator

Closes #192, #126, #78

This makes the promotion rules for Fixed consistent with the rules used within Normed:

  • Fixed and Integer are promoted to floattype
  • Fixed and AbstractFloat are promoted to floattype with sufficient precision

This adds the rule:

  • Fixed and Normed are promoted to floattype

This also stops using @generated function.

This was linked to issues Jul 24, 2020
@kimikage kimikage added the breaking Major breaking change label Jul 24, 2020
@codecov
Copy link

codecov bot commented Jul 24, 2020

Codecov Report

Merging #207 into master will decrease coverage by 1.36%.
The diff coverage is 38.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
- Coverage   89.21%   87.84%   -1.37%     
==========================================
  Files           6        6              
  Lines         482      469      -13     
==========================================
- Hits          430      412      -18     
- Misses         52       57       +5     
Impacted Files Coverage Δ
src/fixed.jl 89.89% <ø> (+2.28%) ⬆️
src/normed.jl 91.27% <ø> (+1.97%) ⬆️
src/FixedPointNumbers.jl 82.55% <31.25%> (-6.93%) ⬇️
src/utilities.jl 88.00% <100.00%> (-8.00%) ⬇️

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 40c9117...9c52516. Read the comment docs.

Copy link
Member

@timholy timholy left a comment

Choose a reason for hiding this comment

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

Sorry I didn't notice this earlier. Very nice improvement. Thanks for adding @inferred to the tests.

This makes the promotion rules for `Fixed` consistent with the rules used within `Normed`:
- `Fixed` and `Integer` are promoted to `floattype`
- `Fixed` and `AbstractFloat` are promoted to `floattype` with sufficient precision

This adds the rule:
- `Fixed` and `Normed` are promoted to `floattype`

This also stops using `@generated` function.
@kimikage
Copy link
Collaborator Author

kimikage commented Aug 6, 2020

I ran rebase master.

I'm not sure how Fixed is used in the wild. All I can do now is pray that this breaking change does not cause a fatal problem.

@kimikage kimikage merged commit ae6b911 into JuliaMath:master Aug 6, 2020
@kimikage kimikage deleted the promotion_rule branch August 6, 2020 14:44
@kimikage kimikage mentioned this pull request Apr 30, 2024
38 tasks
kimikage added a commit to kimikage/FixedPointNumbers.jl that referenced this pull request Apr 30, 2024
kimikage added a commit to kimikage/FixedPointNumbers.jl that referenced this pull request May 1, 2024
kimikage added a commit to kimikage/FixedPointNumbers.jl that referenced this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Major breaking change
Projects
None yet
2 participants