JuliaMath / Interpolations.jl

Fast, continuous interpolation of discrete datasets in Julia
http://juliamath.github.io/Interpolations.jl/
Other
518 stars 110 forks source link

Gridded(Constant{Previous}()) returns wrong results #595

Open nielsls opened 3 months ago

nielsls commented 3 months ago

To be fair, the docs for Constant does mention possibility of numerical errors but this seems quite wrong...

# wrong - should be 20
julia> interpolate(([1,2],),[10,20],Gridded(Constant{Previous}()))(2)
10

# correct
julia> interpolate([10,20],BSpline(Constant{Previous}()))(2)
20.0
mkitti commented 2 months ago

Thanks. I'll take a look.