Skip to content

Commit e101540

Browse files
committed
Uninline float description
1 parent b017761 commit e101540

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,19 @@ public struct ${Self} {
7979
8080
extension ${Self} : CustomStringConvertible {
8181
/// A textual representation of the value.
82-
@inlinable
8382
public var description: String {
84-
if isFinite {
85-
return _float${bits}ToString(self, debug: false)
86-
} else if isNaN {
83+
if isNaN {
8784
return "nan"
88-
} else if sign == .minus {
89-
return "-inf"
9085
} else {
91-
return "inf"
86+
return _float${bits}ToString(self, debug: false)
9287
}
9388
}
9489
}
9590
9691
extension ${Self} : CustomDebugStringConvertible {
9792
/// A textual representation of the value, suitable for debugging.
9893
public var debugDescription: String {
99-
if isFinite || isNaN {
100-
return _float${bits}ToString(self, debug: true)
101-
} else if sign == .minus {
102-
return "-inf"
103-
} else {
104-
return "inf"
105-
}
94+
return _float${bits}ToString(self, debug: true)
10695
}
10796
}
10897

0 commit comments

Comments
 (0)