<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UInt/_(_:_:)-70g4r",
  "metadataVersion" : "0.1.0",
  "role" : "Operator",
  "symbol" : {
    "kind" : "Operator",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:Su1ooiyS2u_SutFZ"
  },
  "title" : "|(_:_:)"
}
-->

# |(_:_:)

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

```
static func | (lhs: UInt, rhs: UInt) -> UInt
```

## Parameters

`lhs`

An integer value.

`rhs`

Another integer value.

## Discussion

A bitwise OR operation results in a value that has each bit set to `1`
where *one or both* of its arguments have that bit set to `1`. For
example:

```
let x: UInt8 = 5          // 0b00000101
let y: UInt8 = 14         // 0b00001110
let z = x | y             // 0b00001111
// z == 15
```

---

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)