Guess you could also do

mysqrt{T<:Real}(x::T) = x>=0 ? sqrt(x) : sqrt(x+0im)

but it will be slower.

Reply via email to