22//
33// This source file is part of the Swift Numerics open source project
44//
5- // Copyright (c) 2019 - 2021 Apple Inc. and the Swift Numerics project authors
5+ // Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
66// Licensed under Apache License v2.0 with Runtime Library Exception
77//
88// See https://swift.org/LICENSE.txt for license information
@@ -26,23 +26,23 @@ extension Complex {
2626 /// because the length can be as much as sqrt(2) times larger than
2727 /// either component, and thus may not be representable in the real type.
2828 ///
29- /// For most use cases, you can use the cheaper `. magnitude`
29+ /// For most use cases, you can use the cheaper `` magnitude` `
3030 /// property (which computes the ∞-norm) instead, which always produces
3131 /// a representable result. See <doc:Magnitude> for more details.
3232 ///
3333 /// Edge cases:
34- /// - If a complex value is not finite, its `. length` is `infinity`.
34+ /// - If a complex value is not finite, its `length` is `infinity`.
3535 ///
36- /// See also `.magnitude`, `. lengthSquared`, `. phase`, `. polar`
37- /// and `init(r:θ:) `.
36+ /// See also `` lengthSquared`` , `` phase`` , `` polar` `
37+ /// and `` init(length:phase:)` `.
3838 @_transparent
3939 public var length : RealType {
4040 let naive = lengthSquared
4141 guard naive. isNormal else { return carefulLength }
4242 return . sqrt( naive)
4343 }
4444
45- // Internal implementation detail of `length`, moving slow path off
45+ // Internal implementation detail of `` length` `, moving slow path off
4646 // of the inline function. Note that even `carefulLength` can overflow
4747 // for finite inputs, but only when the result is outside the range
4848 // of representable values.
@@ -54,21 +54,19 @@ extension Complex {
5454
5555 /// The squared length `(real*real + imaginary*imaginary)`.
5656 ///
57- /// This property is more efficient to compute than `length`, but is
57+ /// This property is more efficient to compute than `` length` `, but is
5858 /// highly prone to overflow or underflow; for finite values that are
5959 /// not well-scaled, `lengthSquared` is often either zero or
6060 /// infinity, even when `length` is a finite number. Use this property
6161 /// only when you are certain that this value is well-scaled.
6262 ///
63- /// For many cases, `. magnitude` can be used instead, which is similarly
63+ /// For many cases, `` magnitude` ` can be used instead, which is similarly
6464 /// cheap to compute and always returns a representable value.
6565 ///
6666 /// Note that because of how `lengthSquared` is used, it is a primary
6767 /// design goal that it be as fast as possible. Therefore, it does not
6868 /// normalize infinities, and may return either `.infinity` or `.nan`
6969 /// for non-finite values.
70- ///
71- /// See also ``length`` and ``magnitude``.
7270 @_transparent
7371 public var lengthSquared : RealType {
7472 x*x + y*y
@@ -93,7 +91,7 @@ extension Complex {
9391 /// - If the complex value is zero or non-finite, phase is `.nan`.
9492 /// - If the complex value is non-finite, length is `.infinity`.
9593 ///
96- /// See also: `. length`, `. phase` and `init(r:θ:) `.
94+ /// See also: `` length`` , `` phase`` and `` init(length:phase:)` `.
9795 public var polar : ( length: RealType , phase: RealType ) {
9896 ( length, phase)
9997 }
@@ -116,7 +114,7 @@ extension Complex {
116114 /// ```
117115 /// - Otherwise, `θ` must be finite, or a precondition failure occurs.
118116 ///
119- /// See also `. length`, `. phase` and `. polar`.
117+ /// See also `` length`` , `` phase`` and `` polar` `.
120118 @inlinable
121119 public init ( length: RealType , phase: RealType ) {
122120 if phase. isFinite {
0 commit comments