Skip to content

Commit 39cc436

Browse files
authored
Merge pull request #34347 from apple/PatrickPijnappel-float-comment
[stdlib] Change misleading comment
2 parents 3c2f1e4 + 8ecd884 commit 39cc436

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/public/core/Integers.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,9 +3010,10 @@ extension FixedWidthInteger {
30103010
let minBitWidth = source.significandWidth
30113011
let isExact = (minBitWidth <= exponent)
30123012
let bitPattern = source.significandBitPattern
3013-
// `RawSignificand.bitWidth` is not available if `RawSignificand` does not
3014-
// conform to `FixedWidthInteger`; we can compute this value as follows if
3015-
// `source` is finite:
3013+
// Determine the actual number of fractional significand bits.
3014+
// `Source.significandBitCount` would not reflect the actual number of
3015+
// fractional significand bits if `Source` is not a fixed-width floating-point
3016+
// type; we can compute this value as follows if `source` is finite:
30163017
let bitWidth = minBitWidth &+ bitPattern.trailingZeroBitCount
30173018
let shift = exponent - Source.Exponent(bitWidth)
30183019
// Use `Self.Magnitude` to prevent sign extension if `shift < 0`.

0 commit comments

Comments
 (0)