Skip to content

Commit 9bb0aeb

Browse files
mcabbottfredrikekreViralBShahvtjnash
authored
Mention norm in docstring of hypot (#42972)
* mention norm in doc of hypot Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com> Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com>
1 parent 6330398 commit 9bb0aeb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

base/math.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ The article is available online at ArXiv at the link
639639
640640
Compute the hypotenuse ``\\sqrt{\\sum |x_i|^2}`` avoiding overflow and underflow.
641641
642+
See also `norm` in the [`LinearAlgebra`](@ref man-linalg) standard library.
643+
642644
# Examples
643645
```jldoctest; filter = r"Stacktrace:(\\n \\[[0-9]+\\].*)*"
644646
julia> a = Int64(10)^10;
@@ -660,6 +662,11 @@ julia> hypot(-5.7)
660662
661663
julia> hypot(3, 4im, 12.0)
662664
13.0
665+
666+
julia> using LinearAlgebra
667+
668+
julia> norm([a, a, a, a]) == hypot(a, a, a, a)
669+
true
663670
```
664671
"""
665672
hypot(x::Number) = abs(float(x))

0 commit comments

Comments
 (0)