Interpolations.jl icon indicating copy to clipboard operation
Interpolations.jl copied to clipboard

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

Open nielsls opened this issue 1 year ago • 1 comments

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

nielsls avatar May 25 '24 18:05 nielsls

Thanks. I'll take a look.

mkitti avatar May 26 '24 04:05 mkitti