Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Commit

Permalink
Fix type-stability problem in interp_coords_1d.
Browse files Browse the repository at this point in the history
See problem report in
#36 (comment)
  • Loading branch information
timholy committed Oct 18, 2014
1 parent b73de68 commit f2293a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/interp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -681,28 +681,28 @@ function interp_coords_1d{T,BC<:Union(BCnearest,BCfill)}(coord1d::Vector{Int}, :
coord1d[2] = ix
coord1d[3] = ix+1
iswrap = false
dx = x-ix
dx = x-convert(T,ix)
elseif x <= 1.5
ix = one(T)
ix = 1
coord1d[1] = 2
coord1d[2] = 1
coord1d[3] = 2
iswrap = true
if x < 1
dx = zero(T)
else
dx = x-ix
dx = x-convert(T,ix)
end
else
ix = convert(T, len)
ix = len
coord1d[1] = len-1
coord1d[2] = len
coord1d[3] = len-1
iswrap = true
if x > len
dx = zero(T)
else
dx = x-ix
dx = x-convert(T,ix)
end
end
return ix, dx, iswrap
Expand Down

0 comments on commit f2293a1

Please sign in to comment.