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

Simplify and improve ilog2(::Real) #9

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

jlapeyre
Copy link
Collaborator

@jlapeyre jlapeyre commented Aug 2, 2023

  • Simplify ilog2 for built in bitstype floats and BigFloat by calling exponent.

  • Some missing tests are added for RoundUp and RoundDown with floating point arguments. An undetected bug was fixed and is tested by these tests.

In fact, it's hard to identify a clear advantage of any of the remaining methods compared to ilog2(x::Any) = exponent(float(x::Any)).

Closes #8

* Simplify ilog2 for built in bitstype floats and BigFloat by calling exponent.

* Some missing tests are added for RoundUp and RoundDown with floating point arguments.
  An undetected bug was fixed and is tested by these tests.

In fact, it's hard to identify a clear advantage of any of the remaining methods compared
to `ilog2(x:Any) = exponent(float(x::Any))`.

Closes JuliaMath#8
@codecov
Copy link

codecov bot commented Aug 2, 2023

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@jlapeyre jlapeyre merged commit decc207 into JuliaMath:master Aug 19, 2024
8 of 10 checks passed
@jlapeyre jlapeyre deleted the use-exponent-for-abstract-float branch August 19, 2024 14:23
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.

better AbstractFloat implimentation
1 participant