Skip to content

Commit 02a5d2c

Browse files
committed
Improve type determination
1 parent 3711196 commit 02a5d2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/monotonic/monotonic.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ end
178178
function interpolate(knots::AbstractVector{<:Number}, A::AbstractArray{TEl,1},
179179
it::TInterpolationType) where {TEl,TInterpolationType<:MonotonicInterpolationType}
180180

181-
interpolate(tweight(A), typeof(first(A)/first(knots)), typeof(first(A)/first(knots)^2), typeof(first(A)/first(knots)^3), knots, A, it)
181+
interpolate(tweight(A),typeof(oneunit(eltype(A)) / oneunit(eltype(knots))),
182+
typeof(oneunit(eltype(A)) / oneunit(eltype(knots))^2),
183+
typeof(oneunit(eltype(A)) / oneunit(eltype(knots))^3),knots,A,it)
182184
end
183185

184186
function (itp::MonotonicInterpolation)(x::Number)

0 commit comments

Comments
 (0)