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

# BinaryInteger Implementations

## Topics

### Operators

[`static func != <Other>(Self, Other) -> Bool`](/documentation/Swift/Int/!=(_:_:)-4jphg)

Returns a Boolean value indicating whether the two given values are not
equal.

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

Returns the result of performing a bitwise AND operation on the two given
values.

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

Returns the result of performing a bitwise AND operation on the two given
values.

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

Multiplies two values and produces their product.

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

Adds two values and produces their sum.

[`static func - (Int, Int) -> Int`](/documentation/Swift/Int/-(_:_:))

Subtracts one value from another and produces their difference.

[`static func == <Other>(Self, Other) -> Bool`](/documentation/Swift/Int/==(_:_:)-1zalu)

Returns a Boolean value indicating whether the two given values are
equal.

[`static func | (Self, Self) -> Self`](/documentation/Swift/Int/_(_:_:)-1e0ee)

Returns the result of performing a bitwise OR operation on the two given
values.

[`static func | (Int, Int) -> Int`](/documentation/Swift/Int/_(_:_:)-26x3w)

Returns the result of performing a bitwise OR operation on the two given
values.

[`static func ^ (Self, Self) -> Self`](/documentation/Swift/Int/_(_:_:)-2yuui)

Returns the result of performing a bitwise XOR operation on the two given
values.

[`static func < <Other>(Self, Other) -> Bool`](/documentation/Swift/Int/_(_:_:)-3r70c)

Returns a Boolean value indicating whether the value of the first
argument is less than that of the second argument.

[`static func > (Self, Self) -> Bool`](/documentation/Swift/Int/_(_:_:)-4e53i)

[`static func ^ (Int, Int) -> Int`](/documentation/Swift/Int/_(_:_:)-591r5)

Returns the result of performing a bitwise XOR operation on the two given
values.

[`static func % (Int, Int) -> Int`](/documentation/Swift/Int/_(_:_:)-6lyj3)

Returns the remainder of dividing the first value by the second.

[`static func > <Other>(Self, Other) -> Bool`](/documentation/Swift/Int/_(_:_:)-7d57p)

Returns a Boolean value indicating whether the value of the first
argument is greater than that of the second argument.

[`static func / (Int, Int) -> Int`](/documentation/Swift/Int/_(_:_:)-7j9bj)

Returns the quotient of dividing the first value by the second.

[`static func <= (Self, Self) -> Bool`](/documentation/Swift/Int/_=(_:_:)-6cfca)

[`static func >= (Self, Self) -> Bool`](/documentation/Swift/Int/_=(_:_:)-7tmrx)

[`static func >= <Other>(Self, Other) -> Bool`](/documentation/Swift/Int/_=(_:_:)-7v58y)

Returns a Boolean value indicating whether the value of the first
argument is greater than or equal to that of the second argument.

[`static func <= <Other>(Self, Other) -> Bool`](/documentation/Swift/Int/_=(_:_:)-yera)

Returns a Boolean value indicating whether the value of the first
argument is less than or equal to that of the second argument.

[`static func << <RHS>(Self, RHS) -> Self`](/documentation/Swift/Int/__(_:_:)-2xfjq)

Returns the result of shifting a value’s binary representation the
specified number of digits to the left.

[`static func << <Other>(Self, Other) -> Self`](/documentation/Swift/Int/__(_:_:)-60q97)

Returns the result of shifting a value’s binary representation the
specified number of digits to the left.

[`static func >> <Other>(Self, Other) -> Self`](/documentation/Swift/Int/__(_:_:)-635pg)

Returns the result of shifting a value’s binary representation the
specified number of digits to the right.

[`static func >> <RHS>(Self, RHS) -> Self`](/documentation/Swift/Int/__(_:_:)-97tkh)

Returns the result of shifting a value’s binary representation the
specified number of digits to the right.

[`static func <<= <Other>(inout Self, Other)`](/documentation/Swift/Int/__=(_:_:)-66xgb)

Stores the result of shifting a value’s binary representation the
specified number of digits to the left in the left-hand-side variable.

[`static func >>= <Other>(inout Self, Other)`](/documentation/Swift/Int/__=(_:_:)-9p0ct)

Stores the result of shifting a value’s binary representation the
specified number of digits to the right in the left-hand-side variable.

[`static func ~ (Self) -> Self`](/documentation/Swift/Int/~(_:))

Returns the inverse of the bits set in the argument.

### Initializers

[`init()`](/documentation/Swift/Int/init())

Creates a new value equal to zero.

[`init<Other>(clamping: Other)`](/documentation/Swift/Int/init(clamping:))

Creates a new instance with the representable value that’s closest to the
given integer.

[`init<T>(truncatingIfNeeded: T)`](/documentation/Swift/Int/init(truncatingIfNeeded:))

Creates a new instance from the bit pattern of the given instance by
sign-extending or truncating to fit this type.

### Instance Properties

[`var bitWidth: Int`](/documentation/Swift/Int/bitWidth-swift.property)

The number of bits in the current binary representation of this value.

[`var description: String`](/documentation/Swift/Int/description)

A textual representation of this value.

### Instance Methods

[`func isMultiple(of: Self) -> Bool`](/documentation/Swift/Int/isMultiple(of:))

Returns `true` if this value is a multiple of the given value, and `false`
otherwise.

[`func quotientAndRemainder(dividingBy: Self) -> (quotient: Self, remainder: Self)`](/documentation/Swift/Int/quotientAndRemainder(dividingBy:))

Returns the quotient and remainder of this value divided by the given
value.

---

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)