From 1e4cc4160447d0f638bda0e63d4a3e527b391821 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 26 Aug 2017 11:25:31 +0100 Subject: [PATCH] fix sqrt(::Directed) (needs some thought though) --- src/SingularIntegralEquations.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SingularIntegralEquations.jl b/src/SingularIntegralEquations.jl index 94bcf85..8b9dcfc 100644 --- a/src/SingularIntegralEquations.jl +++ b/src/SingularIntegralEquations.jl @@ -94,8 +94,8 @@ end Base.log(x::Directed{true}) = log(-x.x) - π*im Base.log(x::Directed{false}) = log(-x.x) + π*im Base.log1p(x::Directed) = log(1+x) -Base.sqrt(x::Directed{true}) = x.x ≥ 0 ? sqrt(complex(x.x)) : -im*sqrt(-x.x) -Base.sqrt(x::Directed{false}) = x.x ≥ 0 ? sqrt(complex(x.x)) : im*sqrt(-x.x) +Base.sqrt(x::Directed{true}) = real(x.x) ≥ 0 ? sqrt(complex(x.x)) : -im*sqrt(-x.x) +Base.sqrt(x::Directed{false}) = real(x.x) ≥ 0 ? sqrt(complex(x.x)) : im*sqrt(-x.x) ^(x::Directed{true},a::Integer) = x.x^a ^(x::Directed{false},a::Integer) = x.x^a ^(x::Directed{true},a::Number) = exp(-a*π*im)*(-x.x)^a