mirror of
https://github.com/apple/swift-numerics
synced 2026-11-22 04:30:45 +00:00
Merge pull request #271 from stephentyrone/none-some
Replace `some BinaryInteger` with an explicit generic parameter.
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -158,8 +158,8 @@ extension FixedWidthInteger {
|
||||
/// and if negative a right shift.
|
||||
/// - rounding rule: the direction in which to round if `count` is negative.
|
||||
@_transparent
|
||||
public func shiftedWithSaturation(
|
||||
leftBy count: some BinaryInteger,
|
||||
public func shiftedWithSaturation<Count: BinaryInteger>(
|
||||
leftBy count: Count,
|
||||
rounding rule: RoundingRule = .down
|
||||
) -> Self {
|
||||
self.shiftedWithSaturation(leftBy: Int(clamping: count), rounding: rule)
|
||||
|
||||
@@ -188,8 +188,8 @@ extension BinaryInteger {
|
||||
/// a.shifted(rightBy: count, rounding: rule)
|
||||
/// a.divided(by: 1 << count, rounding: rule)
|
||||
@_transparent
|
||||
public func shifted(
|
||||
rightBy count: some BinaryInteger,
|
||||
public func shifted<Count: BinaryInteger>(
|
||||
rightBy count: Count,
|
||||
rounding rule: RoundingRule = .down
|
||||
) -> Self {
|
||||
self.shifted(rightBy: Int(clamping: count), rounding: rule)
|
||||
|
||||
Reference in new issue
Block a user