<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Synchronization/Atomic/wrappingSubtract(_:ordering:)-3795w",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Synchronization"
    ],
    "preciseIdentifier" : "s:15Synchronization6AtomicVAAs5Int64VRszrlE16wrappingSubtract_8orderingAE8oldValue_AE03newH0tAE_AA0B14UpdateOrderingVtF"
  },
  "title" : "wrappingSubtract(_:ordering:)"
}
-->

# wrappingSubtract(_:ordering:)

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

```
@discardableResult func wrappingSubtract(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
```

## Parameters

`operand`

An integer value.

`ordering`

The memory ordering to apply on this operation.

## Return Value

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

## Discussion> Note: This operation silently wraps around on overflow, like the
> `&-` operator does on `Int64` values.

---

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)