Skip to content

Commit 81b8db7

Browse files
authored
Replace a strange type determination
I think this part was just trying to promote the type of the fillvalue to something that matches both the coordinates, x, and the coefs. It was doing it in a very strange way. Why not use the standard type promotion machinery?
1 parent 6af9558 commit 81b8db7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/extrapolation/filled.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extrapolate(itp::AbstractInterpolation{T,N,IT}, fillvalue) where {T,N,IT} = Fill
3030
@inline function (etp::FilledExtrapolation{T,N})(x::Vararg{Number,N}) where {T,N}
3131
itp = parent(etp)
3232
coefs = coefficients(itp)
33-
Tret = typeof(prod(x) * zero(eltype(coefs)))
33+
Tret = promote_type(eltype(coefs), typeof.(x)...)
3434
if checkbounds(Bool, itp, x...)
3535
@inbounds itp(x...)
3636
else

0 commit comments

Comments
 (0)