JuliaMath / JuliaMath/Interpolations.jl

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

Open
#595 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
575
Forks
117
PR merge metrics
No merged PRs in 30d

Description

To be fair, the docs for [Constant ](https://docs.juliahub.com/General/Interpolations/stable/api/#Interpolations.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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.