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 Base.precision on Julia v1.11 #185

Merged
merged 1 commit into from
Feb 3, 2024
Merged

Conversation

jondeuce
Copy link
Contributor

@jondeuce jondeuce commented Feb 3, 2024

A recent bugfix on Julia master renamed Base._precision(T) (without a second base argument) to Base._precision_with_base_2(T), which broke precision(Double64). This PR patches that.

Before this PR:

julia-1.10.0> using DoubleFloats

julia-1.10.0> precision(Double64)
106
julia-1.11.0-DEV.1459> precision(Double64)
ERROR: MethodError: no method matching _precision_with_base_2(::Type{Double64})

Closest candidates are:
  _precision_with_base_2(::BigFloat)
   @ Base mpfr.jl:957
  _precision_with_base_2(::Type{BigFloat})
   @ Base mpfr.jl:962
  _precision_with_base_2(::Type{Float64})
   @ Base float.jl:841
  ...

Stacktrace:
 [1] _precision(x::Type, base::Int64)
   @ Base ./float.jl:844
 [2] precision(::Type{Double64}; base::Int64)
   @ Base ./float.jl:847
 [3] precision(::Type{Double64})
   @ Base ./float.jl:847
 [4] top-level scope
   @ REPL[1]:1

After this PR:

julia-1.11.0-DEV.1459> using DoubleFloats

julia-1.11.0-DEV.1459> precision(Double64)
106

Copy link

codecov bot commented Feb 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ac1ef07) 50.16% compared to head (2b0e173) 50.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
- Coverage   50.16%   50.02%   -0.15%     
==========================================
  Files          63       63              
  Lines        3546     3546              
==========================================
- Hits         1779     1774       -5     
- Misses       1767     1772       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JeffreySarnoff
Copy link
Member

thank you

@JeffreySarnoff JeffreySarnoff merged commit cc6f6d3 into JuliaMath:main Feb 3, 2024
6 of 7 checks passed
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.

2 participants