Skip to content

Commit

Permalink
Mention norm in docstring of hypot (JuliaLang#42972)
Browse files Browse the repository at this point in the history
* mention norm in doc of hypot

Co-authored-by: Fredrik Ekre <[email protected]>
Co-authored-by: Viral B. Shah <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
  • Loading branch information
4 people authored and LilithHafner committed Mar 8, 2022
1 parent fd25404 commit eebc7c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ The article is available online at ArXiv at the link
Compute the hypotenuse ``\\sqrt{\\sum |x_i|^2}`` avoiding overflow and underflow.
See also `norm` in the [`LinearAlgebra`](@ref man-linalg) standard library.
# Examples
```jldoctest; filter = r"Stacktrace:(\\n \\[[0-9]+\\].*)*"
julia> a = Int64(10)^10;
Expand All @@ -660,6 +662,11 @@ julia> hypot(-5.7)
julia> hypot(3, 4im, 12.0)
13.0
julia> using LinearAlgebra
julia> norm([a, a, a, a]) == hypot(a, a, a, a)
true
```
"""
hypot(x::Number) = abs(float(x))
Expand Down

0 comments on commit eebc7c5

Please sign in to comment.