From 6cc20eea504ce73ae32bafe8c2d40eabe1ba1f96 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Sun, 29 Dec 2019 15:12:50 +0800 Subject: [PATCH] prevent promotion to Float64 in unwrap --- src/utilities.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utilities.jl b/src/utilities.jl index 1efe7367c..6a7873b2f 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -105,7 +105,8 @@ function unwrap!(M::Array, dim=1) # d = M[i,:,:,...,:] - M[i-1,:,...,:] # M[i,:,:,...,:] -= floor((d+π) / (2π)) * 2π d = M[alldims(i)...] - M[alldims(i-1)...] - M[alldims(i)...] -= floor.((d .+ π) / 2π) * 2π + π2 = eltype(M)(2π) + M[alldims(i)...] -= floor.((d .+ π) / π2) * π2 end return M end