<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Int128/FixedWidthInteger-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "FixedWidthInteger Implementations"
}
-->

# FixedWidthInteger Implementations

## Topics

### Operators

[`static func &* (Int128, Int128) -> Int128`](/documentation/Swift/Int128/&*(_:_:))

Returns the product of the two given values, wrapping the result in case
of any overflow.

[`static func &* (Self, Self) -> Self`](/documentation/Swift/Int128/&*(_:_:)-ctty)

Returns the product of the two given values, wrapping the result in case
of any overflow.

[`static func &*= (inout Self, Self)`](/documentation/Swift/Int128/&*=(_:_:))

Multiplies two values and stores the result in the left-hand-side
variable, wrapping any overflow.

[`static func &+ (Self, Self) -> Self`](/documentation/Swift/Int128/&+(_:_:))

Returns the sum of the two given values, wrapping the result in case of
any overflow.

[`static func &+= (inout Self, Self)`](/documentation/Swift/Int128/&+=(_:_:))

Adds two values and stores the result in the left-hand-side variable,
wrapping any overflow.

[`static func &- (Self, Self) -> Self`](/documentation/Swift/Int128/&-(_:_:))

Returns the difference of the two given values, wrapping the result in
case of any overflow.

[`static func &-= (inout Self, Self)`](/documentation/Swift/Int128/&-=(_:_:))

Subtracts the second value from the first and stores the difference in the
left-hand-side variable, wrapping any overflow.

[`static func &>> <Other>(Self, Other) -> Self`](/documentation/Swift/Int128/&__(_:_:)-227qu)

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 &>> (Self, Self) -> Self`](/documentation/Swift/Int128/&__(_:_:)-71ih1)

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>(Self, Other) -> Self`](/documentation/Swift/Int128/&__(_:_:)-9gig)

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 &<< (Self, Self) -> Self`](/documentation/Swift/Int128/&__(_:_:)-lkqj)

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>(inout Self, Other)`](/documentation/Swift/Int128/&__=(_:_:)-1pdlg)

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 &<<= (inout Int128, Int128)`](/documentation/Swift/Int128/&__=(_:_:)-2vr5o)

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>(inout Self, Other)`](/documentation/Swift/Int128/&__=(_:_:)-5pnjk)

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 &>>= (inout Int128, Int128)`](/documentation/Swift/Int128/&__=(_:_:)-69tya)

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.

### Initializers

[`init<T>(T)`](/documentation/Swift/Int128/init(_:)-3gl5w)

[`init?(String)`](/documentation/Swift/Int128/init(_:)-9xe9j)

Creates a new integer value from the given string.

[`init?<S>(S, radix: Int)`](/documentation/Swift/Int128/init(_:radix:))

Creates a new integer value from the given string and radix.

[`init(bigEndian: Self)`](/documentation/Swift/Int128/init(bigEndian:))

Creates an integer from its big-endian representation, changing the byte
order if necessary.

[`init?<T>(exactly: T)`](/documentation/Swift/Int128/init(exactly:)-yans)

[`init(littleEndian: Self)`](/documentation/Swift/Int128/init(littleEndian:))

Creates an integer from its little-endian representation, changing the
byte order if necessary.

### Instance Properties

[`var bigEndian: Self`](/documentation/Swift/Int128/bigEndian)

The big-endian representation of this integer.

[`var byteSwapped: Int128`](/documentation/Swift/Int128/byteSwapped)

A representation of this integer with the byte order swapped.

[`var leadingZeroBitCount: Int`](/documentation/Swift/Int128/leadingZeroBitCount)

The number of leading zeros in this value’s binary representation.

[`var littleEndian: Self`](/documentation/Swift/Int128/littleEndian)

The little-endian representation of this integer.

[`var nonzeroBitCount: Int`](/documentation/Swift/Int128/nonzeroBitCount)

The number of bits equal to 1 in this value’s binary representation.

### Instance Methods

[`func addingReportingOverflow(Int128) -> (partialValue: Int128, overflow: Bool)`](/documentation/Swift/Int128/addingReportingOverflow(_:))

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: Int128) -> (partialValue: Int128, overflow: Bool)`](/documentation/Swift/Int128/dividedReportingOverflow(by:))

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 multipliedFullWidth(by: Self) -> (high: Self, low: Self.Magnitude)`](/documentation/Swift/Int128/multipliedFullWidth(by:))

Returns a tuple containing the high and low parts of the result of
multiplying this value by the given value.

[`func multipliedReportingOverflow(by: Int128) -> (partialValue: Int128, overflow: Bool)`](/documentation/Swift/Int128/multipliedReportingOverflow(by:))

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: Int128) -> (partialValue: Int128, overflow: Bool)`](/documentation/Swift/Int128/remainderReportingOverflow(dividingBy:))

Returns the remainder after dividing this value by the given value, along
with a Boolean value indicating whether overflow occurred during division.

[`func subtractingReportingOverflow(Int128) -> (partialValue: Int128, overflow: Bool)`](/documentation/Swift/Int128/subtractingReportingOverflow(_:))

Returns the difference obtained by subtracting the given value from this
value, along with a Boolean value indicating whether overflow occurred in
the operation.

### Type Properties

[`static var bitWidth: Int`](/documentation/Swift/Int128/bitWidth)

The number of bits used for the underlying binary representation of
values of this type.

[`static var max: Int128`](/documentation/Swift/Int128/max)

The maximum representable integer in this type.

[`static var min: Int128`](/documentation/Swift/Int128/min)

The minimum representable integer in this type.

### Type Methods

[`static func random(in: Range<Self>) -> Self`](/documentation/Swift/Int128/random(in:)-4lf3w)

Returns a random value within the specified range.

[`static func random(in: ClosedRange<Self>) -> Self`](/documentation/Swift/Int128/random(in:)-55a79)

Returns a random value within the specified range.

[`static func random<T>(in: ClosedRange<Self>, using: inout T) -> Self`](/documentation/Swift/Int128/random(in:using:)-4e4vx)

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`](/documentation/Swift/Int128/random(in:using:)-7t428)

Returns a random value within the specified range, using the given
generator as a source for randomness.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)