Closed mkitti closed 3 years ago
Could we extend Base.float to work with SaferIntegers?
Base.float
SaferIntegers
julia> using SaferIntegers julia> float(SafeInt(3)) ERROR: MethodError: no method matching AbstractFloat(::SafeInt64) Closest candidates are: (::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200 (::Type{T})(::T) where T<:Number at boot.jl:760 (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50 ... Stacktrace: [1] float(x::SafeInt64) @ Base .\float.jl:206 [2] top-level scope @ REPL[2]:1 julia> Base.float(x::SafeInteger) = Base.float(SaferIntegers.baseint(x)) julia> float(SafeInt(3)) 3.0
x.f. https://github.com/JuliaMath/Interpolations.jl/issues/457
Fixed by 8eec6df6
Could we extend
Base.float
to work withSaferIntegers
?