File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2185,7 +2185,9 @@ extension BinaryFloatingPoint {
2185
2185
sign: source. sign,
2186
2186
exponentBitPattern: Self . nan. exponentBitPattern,
2187
2187
significandBitPattern: payload | Self . nan. significandBitPattern)
2188
- return payload_ == payload ? ( value, true ) : ( value, false )
2188
+ // We define exactness by equality after roundtripping; since NaN is never
2189
+ // equal to itself, it can never be converted exactly.
2190
+ return ( value, false )
2189
2191
}
2190
2192
2191
2193
let exponent = source. exponent
@@ -2299,8 +2301,7 @@ extension BinaryFloatingPoint {
2299
2301
/// exactly.
2300
2302
///
2301
2303
/// If the given floating-point value cannot be represented exactly, the
2302
- /// result is `nil`. A value that is NaN ("not a number") cannot be
2303
- /// represented exactly if its payload cannot be encoded exactly.
2304
+ /// result is `nil`.
2304
2305
///
2305
2306
/// - Parameter value: A floating-point value to be converted.
2306
2307
@inlinable // FIXME(sil-serialize-all)
You can’t perform that action at this time.
0 commit comments