We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hypot
1 parent f8a25b5 commit 2ba59f2Copy full SHA for 2ba59f2
base/math.jl
@@ -613,6 +613,7 @@ julia> hypot(3, 4im)
613
hypot(x::Number, y::Number) = hypot(promote(x, y)...)
614
hypot(x::Complex, y::Complex) = hypot(abs(x), abs(y))
615
hypot(x::T, y::T) where {T<:Real} = hypot(float(x), float(y))
616
+hypot(x::T, y::T) where {T<:Number} = (z = y/x; abs(x) * sqrt(one(z) + z*z))
617
function hypot(x::T, y::T) where T<:AbstractFloat
618
#Return Inf if either or both imputs is Inf (Compliance with IEEE754)
619
if isinf(x) || isinf(y)
0 commit comments