Required Static Propertyswift 6.0.1Swift
min
The minimum representable integer in this type.
static var min: Self { get }
For unsigned integer types, this value is always 0
. For signed integer types, this value is -(2 ** (bitWidth - 1))
, where **
is exponentiation.
Other requirements
Type members
init(bigEndian: Self
) Creates an integer from its big-endian representation, changing the byte order if necessary.
init(littleEndian: Self
) Creates an integer from its little-endian representation, changing the byte order if necessary.
static var bitWidth: Int
The number of bits used for the underlying binary representation of values of this type.
static var max: Self
The maximum representable integer in this type.
static func &* (lhs: Self, rhs: Self
) -> Self Returns the product of the two given values, wrapping the result in case of any overflow.
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 &<<= (lhs: inout Self, rhs: 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, and stores the result in the left-hand-side variable.
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 &>>= (lhs: inout Self, rhs: Self
) 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.
Instance members
var bigEndian: Self
The big-endian representation of this integer.
var byteSwapped: Self
A representation of this integer with the byte order swapped.
var leadingZeroBitCount: Int
The number of leading zeros in this value’s binary representation.
var littleEndian: Self
The little-endian representation of this integer.
var nonzeroBitCount: Int
The number of bits equal to 1 in this value’s binary representation.
func addingReportingOverflow(Self
) -> (partialValue: Self, overflow: Bool) Returns the sum of this value and the given value, along with a Boolean value indicating whether overflow occurred in the operation.
func dividedReportingOverflow(by: Self
) -> (partialValue: Self, overflow: Bool) Returns the quotient obtained by dividing this value by the given value, along with a Boolean value indicating whether overflow occurred in the operation.
func dividingFullWidth((high: Self, low: Self.Magnitude)
) -> (quotient: Self, remainder: Self) Returns a tuple containing the quotient and remainder obtained by dividing the given value by this value.
func multipliedFullWidth(by: Self
) -> (high: Self, low: Self.Magnitude) Returns a tuple containing the high and low parts of the result of multiplying this value by the given value.
func multipliedReportingOverflow(by: Self
) -> (partialValue: Self, overflow: Bool) Returns the product of this value and the given value, along with a Boolean value indicating whether overflow occurred in the operation.
func remainderReportingOverflow(dividingBy: Self
) -> (partialValue: Self, overflow: Bool) Returns the remainder after dividing this value by the given value, along with a Boolean value indicating whether overflow occurred during division.
func subtractingReportingOverflow(Self
) -> (partialValue: Self, overflow: Bool) Returns the difference obtained by subtracting the given value from this value, along with a Boolean value indicating whether overflow occurred in the operation.