JuliaMath / JuliaMath/Interpolations.jl

Mismatch between input datatype and interpolated type for `Float32`

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

Description

Suppose you have an array of
```julia
a = rand(Float32, (10, 11))
```
As you have mentioned in [this commit](https://github.com/JuliaMath/Interpolations.jl/commit/76e8651dd58f8bfe2163b70a5e7b72c1586238a1), the `eltype` of the interpolate object
```julia
itp = interpolate(a, BSpline(Linear()))
```
is `Float32`. Then we want to calculate the value of
```julia
julia> typeof(itp(1.1, 1.1))
Float64
```
Then, interestingly
```julia
julia> typeof(itp(1.1f0, 1.1f0))
Float32
```

I think this is an issue with handling the datatypes. I suggest that the interpolation output type should be the input data `a` we feed the function with, NOT the input type of the `itp`.

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.