Skip to content

Commit 8580e7c

Browse files
Inline-always floating-point .radix and additive arithmetic .zero for 5.1 (#25799)
* Make AdditiveArithmetic.zero @_transparent (#25658) * FloatingPoint.radix should be inlinable. * Switch transparent to inlinable+inline(__always).
1 parent fc1ed90 commit 8580e7c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,7 @@ extension BinaryFloatingPoint {
20482048
/// following formula, where `**` is exponentiation:
20492049
///
20502050
/// let magnitude = x.significand * F.radix ** x.exponent
2051+
@inlinable @inline(__always)
20512052
public static var radix: Int { return 2 }
20522053

20532054
/// Creates a new floating-point value using the sign of one value and the

stdlib/public/core/Integers.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public extension AdditiveArithmetic where Self : ExpressibleByIntegerLiteral {
133133
///
134134
/// Zero is the identity element for addition. For any value,
135135
/// `x + .zero == x` and `.zero + x == x`.
136+
@inlinable @inline(__always)
136137
static var zero: Self {
137138
return 0
138139
}

0 commit comments

Comments
 (0)