FixedWidthInteger
public protocol FixedWidthInteger : Integer
Mechanica
From SE-0104 (Swift 4), Int nad UInt families will conform to FixedWidthInteger. https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md - TODO: This protocol should be removed with with Swift 4.
-
The maximum representable integer in this type.
Declaration
Swift
static var max: Self
-
The minimum representable value.
Declaration
Swift
static var min: Self
-
random(in:)
Extension methodMechanica
Returns a random Integer bounded by a closed interval range.
Declaration
Swift
public static func random(in range: CountableClosedRange<Self>) -> Self
-
random(in:)
Extension methodMechanica
Returns a random Integer bounded by a closed interval range.
Declaration
Swift
public static func random(in range: CountableRange<Self>) -> Self