byteSwapped
A representation of this integer with the byte order swapped.
var byteSwapped: Self { get }
A representation of this integer with the byte order swapped.
var byteSwapped: Self { get }
import Swift
protocol FixedWidthInteger : BinaryInteger, LosslessStringConvertible where Self.Magnitude : FixedWidthInteger, Self.Magnitude : UnsignedInteger, Self.Stride : FixedWidthInteger, Self.Stride : SignedInteger
An integer type that uses a fixed size for every instance.
init(bigEndian value: Self)
Creates an integer from its big-endian representation, changing the byte order if necessary.
init(littleEndian value: Self)
Creates an integer from its little-endian representation, changing the byte order if necessary.
static var bitWidth: Int { get }
The number of bits used for the underlying binary representation of values of this type.
static var max: Self { get }
The maximum representable integer in this type.
static var min: Self { get }
The minimum representable integer in this type.
var bigEndian: Self { get }
The big-endian representation of this integer.
var leadingZeroBitCount: Int { get }
The number of leading zeros in this value’s binary representation.
var littleEndian: Self { get }
The little-endian representation of this integer.
var nonzeroBitCount: Int { get }
The number of bits equal to 1 in this value’s binary representation.
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.
func addingReportingOverflow(_ rhs: 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 rhs: 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(_ dividend: (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 other: 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 rhs: 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 rhs: 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(_ rhs: 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.