Skip to content

Commit ae7f7bb

Browse files
committed
Spell "Float80(1 << 64)" as "0x1.0p64L"
instead of "18446744073709551616.0L"
1 parent ec7f7b0 commit ae7f7bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/runtime/SwiftDtoa.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,9 +1177,9 @@ size_t swift_format_float80(long double d, char *dest, size_t length)
11771177
swift_decompose_float80(d, digits, sizeof(digits), &decimalExponent);
11781178
// People use long double to model integers <= 2^64, so we use that
11791179
// as a cutoff for decimal vs. exponential format.
1180-
// The constant is written out in full here since it can't be
1181-
// expressed as a 64-bit integer.
1182-
if (decimalExponent < -3 || fabsl(d) > 18446744073709551616.0L) {
1180+
// The constant is written out as a float80 (aka "long double") literal
1181+
// here since it can't be expressed as a 64-bit integer.
1182+
if (decimalExponent < -3 || fabsl(d) > 0x1.0p64L) {
11831183
return swift_format_exponential(dest, length, signbit(d),
11841184
digits, digitCount, decimalExponent);
11851185
} else {

0 commit comments

Comments
 (0)