Skip to content

Commit

Permalink
use Base._precision_with_base_2 instead of Base._precision if def…
Browse files Browse the repository at this point in the history
…ined
  • Loading branch information
jondeuce committed Feb 3, 2024
1 parent ac1ef07 commit 2b0e173
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 2b0e173

Please sign in to comment.