init?(String)
Creates a new integer value from the given string.
init<T>(T)
Creates an integer from the given floating-point value, rounding toward zero. Any fractional part of the value passed as source
is removed.
init?<S>(S, radix: Int)
Creates a new integer value from the given string and radix.
init(bigEndian: Self)
Creates an integer from its big-endian representation, changing the byte order if necessary.
init<Other>(clamping: Other)
Creates a new instance with the representable value that’s closest to the given integer.
init?<T>(exactly: T)
Creates an integer from the given floating-point value, if it can be represented exactly.
init(littleEndian: Self)
Creates an integer from its little-endian representation, changing the byte order if necessary.
init<T>(truncatingIfNeeded: T)
Creates a new instance from the bit pattern of the given instance by truncating or sign-extending if needed to fit this type.
static func random(in: ClosedRange<Self>) -> Self
Returns a random value within the specified range.
static func random(in: Range<Self>) -> Self
Returns a random value within the specified range.
static func random<T>(in: ClosedRange<Self>, using: inout T) -> Self
Returns a random value within the specified range, using the given generator as a source for randomness.
static func random<T>(in: Range<Self>, using: inout T) -> Self
Returns a random value within the specified range, using the given generator as a source for randomness.
static func &* (lhs: Self, rhs: Self) -> Self
static func &+ (lhs: Self, rhs: Self) -> Self
Returns the sum of the two given values, wrapping the result in case of any overflow.
static func &+= (lhs: inout Self, rhs: Self)
Adds two values and stores the result in the left-hand-side variable, wrapping any overflow.
static func &- (lhs: Self, rhs: Self) -> Self
Returns the difference of the two given values, wrapping the result in case of any overflow.
static func &-= (lhs: inout Self, rhs: Self)
Subtracts the second value from the first and stores the difference in the left-hand-side variable, wrapping any overflow.
static func &<< <Other>(lhs: Self, rhs: Other) -> Self
Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width.
static func &<< (lhs: Self, rhs: Self) -> Self
Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width.
static func &<<= <Other>(lhs: inout Self, rhs: Other)
Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.
static func &>> <Other>(lhs: Self, rhs: Other) -> Self
Returns the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width.
static func &>> (lhs: Self, rhs: Self) -> Self
Returns the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width.
static func &>>= <Other>(lhs: inout Self, rhs: Other)
Calculates the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.
static func << <Other>(lhs: Self, rhs: Other) -> Self
Returns the result of shifting a value’s binary representation the specified number of digits to the left.
static func <<= <Other>(lhs: inout Self, rhs: Other)
static func >> <Other>(lhs: Self, rhs: Other) -> Self
Returns the result of shifting a value’s binary representation the specified number of digits to the right.
static func >>= <Other>(lhs: inout Self, rhs: Other)
static func ~ (x: Self) -> Self
Returns the inverse of the bits set in the argument.