---
title: "max(_:ordering:)"
framework: synchronization
role: symbol
role_heading: Instance Method
path: "synchronization/atomic/max(_:ordering:)-7z7ub"
---

# max(_:ordering:)

Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.

## Declaration

```swift
@discardableResult func max(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
```

## Parameters

- `operand`: An integer value.
- `ordering`: The memory ordering to apply on this operation.

## Return Value

Return Value A tuple containing the original value before the operation and the new value after the operation.
