bigfloat transcendentials don't work on julia 1.11
Hi, thanks for the package! It seems that the connection with BigFloat does not work on Julia 1.11:
The MWE
using MultiFloats
MultiFloats.use_bigfloat_transcendentals()
x::Float64x2=10
log10(x)
works for Julia 1.10, but on 1.11 it gives
ERROR: MethodError: no method matching _precision_with_base_2(::Type{MultiFloat{Float64, 2}})
The function `_precision_with_base_2` exists, but no method is defined for this combination of argument types.
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:872
...
Stacktrace:
[1] _precision(x::Type, base::Int64)
@ Base ./float.jl:875
[2] precision(::Type{MultiFloat{Float64, 2}}; base::Int64)
@ Base ./float.jl:878
[3] precision(::Type{MultiFloat{Float64, 2}})
@ Base ./float.jl:878
[4] log10(x::MultiFloat{Float64, 2})
@ MultiFloats ~/.julia/packages/MultiFloats/JtImH/src/MultiFloats.jl:1465
[5] top-level scope
@ REPL[10]:1
Hey @j-fu, thanks for your interest in MultiFloats.jl! This issue occurs because the Julia authors have once again changed the way that Base.precision(::Type{T}) is internally implemented in Julia 1.11, with no mention in the v1.11 release notes. I find it quite annoying that these changes occur without warning, but for the time being, you can use the following patch to restore the old functionality:
using MultiFloats
@inline Base.precision(::Type{MultiFloat{T,N}}) where {T,N} =
N * precision(T) + (N - 1) # implicit bits of precision between limbs
After issuing this definition, MultiFloats.use_bigfloat_transcendentals() and log10(::MultiFloat) should work just fine. I am currently working on a new major release MultiFloats.jl v3.0 that will fix this and several other issues, notably #42.
Thanks! This works now. I also had to define Base.:^ and Base.round. But that may be something after that PR is finished. I put this repo on watch...
Finding this issue took me a while but solves my log issue. On 1.11.6.