We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4352c71 commit e5aa1a8Copy full SHA for e5aa1a8
stdlib/core/FloatingPoint.swift.gyb
@@ -181,7 +181,7 @@ extension ${Self} : FloatingPointNumber {
181
return _toBitPattern() & mask
182
}
183
184
- static func inf() -> ${Self} {
+ static func infinite() -> ${Self} {
185
return _fromBitPattern(${getInfBitPattern(bits)})
186
187
@@ -235,7 +235,7 @@ extension ${Self} : FloatingPointNumber {
235
return false
236
237
// Alternative implementation that is not safe in case of SNaN:
238
- // return abs(self) == ${Self}.inf()
+ // return abs(self) == ${Self}.infinite()
239
240
241
var isNaN: Bool {
stdlib/core/FloatingPointOperations.swift
@@ -53,7 +53,7 @@ protocol FloatingPointNumber {
53
// FIXME: make these readonly static properties.
54
55
/// Returns positive infinity.
56
- class func inf() -> Self
+ class func infinite() -> Self
57
58
/// Returns a quiet NaN.
59
class func NaN() -> Self
test/stdlib/Float.swift
@@ -168,12 +168,12 @@ func checkInf(inf: TestFloat) {
168
169
170
func testInf() {
171
- var stdlibPlusInf = TestFloat.inf()
+ var stdlibPlusInf = TestFloat.infinite()
172
checkInf(stdlibPlusInf)
173
_precondition(!stdlibPlusInf.isSignMinus)
174
_precondition(stdlibPlusInf.floatingPointClass == .PositiveInfinity)
175
176
- var stdlibMinusInf = -TestFloat.inf()
+ var stdlibMinusInf = -TestFloat.infinite()
177
checkInf(stdlibMinusInf)
178
_precondition(stdlibMinusInf.isSignMinus)
179
_precondition(stdlibMinusInf.floatingPointClass == .NegativeInfinity)
test/stdlib/FloatingPointConversionOverflow.swift
@@ -41,10 +41,10 @@ import Darwin
41
// Interpret the command line arguments.
42
let arg = Process.arguments[1]
43
44
-let pd = +Double.inf()
45
-let nd = -Double.inf()
46
-let pf = +Float.inf()
47
-let nf = -Float.inf()
+let pd = +Double.infinite()
+let nd = -Double.infinite()
+let pf = +Float.infinite()
+let nf = -Float.infinite()
48
49
println("GOOD") // CHECK: GOOD
50
test/stdlib/Print.swift
@@ -213,17 +213,17 @@ test_IntegerPrinting()
213
// CHECK: test_IntegerPrinting done
214
215
func test_FloatingPointPrinting() {
216
- printedIs(Float.inf(), "inf")
217
- printedIs(-Float.inf(), "-inf")
+ printedIs(Float.infinite(), "inf")
+ printedIs(-Float.infinite(), "-inf")
218
printedIs(Float.NaN(), "nan")
219
printedIs(Float(0.0), "0.0")
220
printedIs(Float(1.0), "1.0")
221
printedIs(Float(-1.0), "-1.0")
222
printedIs(Float(100.125), "100.125")
223
printedIs(Float(-100.125), "-100.125")
224
225
- printedIs(Double.inf(), "inf")
226
- printedIs(-Double.inf(), "-inf")
+ printedIs(Double.infinite(), "inf")
+ printedIs(-Double.infinite(), "-inf")
227
printedIs(Double.NaN(), "nan")
228
printedIs(Double(0.0), "0.0")
229
printedIs(Double(1.0), "1.0")
0 commit comments