Skip to content

Commit 1bfce98

Browse files
committed
Revise finite/infinite note for NaN.
Incorporates PR feedback from @tbkka.
1 parent 9eabba5 commit 1bfce98

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
11301130
/// A Boolean value indicating whether this instance is finite.
11311131
///
11321132
/// All values other than NaN and infinity are considered finite, whether
1133-
/// normal or subnormal.
1133+
/// normal or subnormal. For NaN, both `isFinite` and `isInfinite` are false.
11341134
var isFinite: Bool { get }
11351135

11361136
/// A Boolean value indicating whether the instance is equal to zero.
@@ -1157,8 +1157,7 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
11571157

11581158
/// A Boolean value indicating whether the instance is infinite.
11591159
///
1160-
/// Note that `isFinite` and `isInfinite` don't form a dichotomy, because
1161-
/// they are not total: If `x` is `NaN`, then both properties are `false`.
1160+
/// For NaN, both `isFinite` and `isInfinite` are false.
11621161
var isInfinite: Bool { get }
11631162

11641163
/// A Boolean value indicating whether the instance is NaN ("not a number").

0 commit comments

Comments
 (0)