Skip to content

Commit af461ec

Browse files
authored
Improve description of the pi constant (#41585)
1 parent 823fa99 commit af461ec

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,19 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
328328
/// `infinity` is greater than this value.
329329
static var greatestFiniteMagnitude: Self { get }
330330

331-
/// The mathematical constant pi.
331+
/// The [mathematical constant π][wiki], approximately equal to 3.14159.
332+
///
333+
/// When measuring an angle in radians, π is equivalent to a half-turn.
332334
///
333-
/// This value should be rounded toward zero to keep user computations with
334-
/// angles from inadvertently ending up in the wrong quadrant. A type that
335-
/// conforms to the `FloatingPoint` protocol provides the value for `pi` at
336-
/// its best possible precision.
335+
/// This value is rounded toward zero to keep user computations with angles
336+
/// from inadvertently ending up in the wrong quadrant. A type that conforms
337+
/// to the `FloatingPoint` protocol provides the value for `pi` at its best
338+
/// possible precision.
337339
///
338340
/// print(Double.pi)
339341
/// // Prints "3.14159265358979"
342+
///
343+
/// [wiki]: https://en.wikipedia.org/wiki/Pi
340344
static var pi: Self { get }
341345

342346
// NOTE: Rationale for "ulp" instead of "epsilon":

0 commit comments

Comments
 (0)