diff --git a/common.jl b/common.jl index b7035db..6a95d8a 100644 --- a/common.jl +++ b/common.jl @@ -47,7 +47,7 @@ which_index(s::system, dim::Int, coord::Int)::Int = (dim - 1) * (s.n - 1) + coor function nearest(s::system, Δk::Int)::Int # TODO: Optimize while true - if Δk > (s.N ÷ 2 - 1) + if Δk >= s.N ÷ 2 Δk -= s.N elseif Δk < -s.N ÷ 2 Δk += s.N