Skip to content

Commit 5d47a0d

Browse files
author
Maxim Moiseev
committed
[stdlib] init<T : FloatingPoint> ==> init<T : BinaryFloatingPoint>
1 parent a5ff35c commit 5d47a0d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

stdlib/public/core/DoubleWidth.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ public struct DoubleWidth<Base : FixedWidthInteger> :
9797
}
9898
}
9999

100-
public init<T : FloatingPoint>(_ source: T) {
100+
public init<T : BinaryFloatingPoint>(_ source: T) {
101101
fatalError()
102102
}
103103

104-
public init?<T : FloatingPoint>(exactly source: T) {
104+
public init?<T : BinaryFloatingPoint>(exactly source: T) {
105105
fatalError()
106106
}
107-
107+
108108
public init<T : BinaryFloatingPoint>(_ source: T)
109109
where T.RawSignificand : FixedWidthInteger
110110
{

stdlib/public/core/Integers.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ public protocol BinaryInteger :
13301330
/// // y == nil
13311331
///
13321332
/// - Parameter source: A floating-point value to convert to an integer.
1333-
init?<T : FloatingPoint>(exactly source: T)
1333+
init?<T : BinaryFloatingPoint>(exactly source: T)
13341334

13351335
/// Creates an integer from the given floating-point value, rounding toward
13361336
/// zero.
@@ -1348,7 +1348,7 @@ public protocol BinaryInteger :
13481348
///
13491349
/// - Parameter source: A floating-point value to convert to an integer.
13501350
/// `source` must be representable in this type after rounding toward zero.
1351-
init<T : FloatingPoint>(_ source: T)
1351+
init<T : BinaryFloatingPoint>(_ source: T)
13521352

13531353
/// Creates a new instance from the given integer.
13541354
///
@@ -1528,7 +1528,7 @@ extension BinaryInteger {
15281528
self = 0
15291529
}
15301530

1531-
public init?<T : FloatingPoint>(exactly source: T) {
1531+
public init?<T : BinaryFloatingPoint>(exactly source: T) {
15321532
// FIXME(integers): implement
15331533
fatalError()
15341534
}
@@ -2952,7 +2952,7 @@ ${assignmentOperatorComment(x.operator, True)}
29522952

29532953
extension ${Self} {
29542954
// FIXME(integers): implement me in a less terrible way
2955-
public init<T : FloatingPoint>(_ source: T) {
2955+
public init<T : BinaryFloatingPoint>(_ source: T) {
29562956
% for (FloatType, FloatBits) in [
29572957
% ('Float', 32), ('Double', 64), ('Float80', 80)]:
29582958
% if FloatType == 'Float80':

test/Prototypes/BigInt.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ public struct _BigInt<Word: FixedWidthInteger & UnsignedInteger> :
142142
self.init(source)
143143
}
144144

145-
public init<T : FloatingPoint>(_ source: T) {
145+
public init<T : BinaryFloatingPoint>(_ source: T) {
146146
fatalError("Not implemented")
147147
}
148148

149-
public init?<T : FloatingPoint>(exactly source: T) {
149+
public init?<T : BinaryFloatingPoint>(exactly source: T) {
150150
fatalError("Not implemented")
151151
}
152152

@@ -1206,7 +1206,7 @@ struct Bit : FixedWidthInteger, UnsignedInteger {
12061206
self = value
12071207
}
12081208

1209-
init?<T: FloatingPoint>(exactly source: T) {
1209+
init?<T: BinaryFloatingPoint>(exactly source: T) {
12101210
switch source {
12111211
case T(0): value = 0
12121212
case T(1): value = 1
@@ -1215,7 +1215,7 @@ struct Bit : FixedWidthInteger, UnsignedInteger {
12151215
}
12161216
}
12171217

1218-
init<T: FloatingPoint>(_ source: T) {
1218+
init<T: BinaryFloatingPoint>(_ source: T) {
12191219
self = Bit(exactly: source.rounded(.down))!
12201220
}
12211221

0 commit comments

Comments
 (0)