Skip to content

Commit

Permalink
Merge pull request #185 from jondeuce/main
Browse files Browse the repository at this point in the history
Fix `Base.precision` on Julia v1.11
  • Loading branch information
JeffreySarnoff authored Feb 3, 2024
2 parents ac1ef07 + 2b0e173 commit cc6f6d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Double.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ DoubleFloat(x::Int64) = Double64(x, zero(Int64))
DoubleFloat(x::Int32) = Double32(x, zero(Int32))
DoubleFloat(x::Int16) = Double16(x, zero(Int16))

# overload Base._precision to support the base keyword in Julia 1.8
let precision = isdefined(Base, :_precision) ? :_precision : :precision
# overload Base._precision_with_base_2 or Base._precision to support the base keyword in Julia 1.8
let precision = isdefined(Base, :_precision_with_base_2) ? :_precision_with_base_2 : isdefined(Base, :_precision) ? :_precision : :precision
@eval Base.$precision(::Type{DoubleFloat{T}}) where {T<:IEEEFloat} = 2*Base.$precision(T)
end

Expand Down

0 comments on commit cc6f6d3

Please sign in to comment.