When x::Vector{Int} and y::Vector{Float32}, I expect the outcome to be a Float32, but it's inconsistent:
julia> interp = Interpolations.interpolate(([1,2,3],), [1.0f0, 2.0f0, 1.0f0], Interpolations.Gridded(Interpolations.Linear()));
julia> interp(2)
2.0
julia> interp([2])
1-element Array{Float64,1}:
2.0
julia> ex = Interpolations.extrapolate(interp, NaN32);
julia> ex(2)
2.0
julia> ex([2])
1-element Array{Float32,1}:
2.0
If my inputs are Float32, then all is fine, but for my use case, x is the number of seconds since some reference time, and I am a bit worried about the loss of precision that comes from early Float32 conversion.
When
x::Vector{Int}andy::Vector{Float32}, I expect the outcome to be aFloat32, but it's inconsistent:If my inputs are
Float32, then all is fine, but for my use case,xis the number of seconds since some reference time, and I am a bit worried about the loss of precision that comes from earlyFloat32conversion.