<!--
{
  "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/Int8/&-=(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Operator",
  "symbol" : {
    "kind" : "Operator",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s17FixedWidthIntegerPsE3aseoiyyxz_xtFZ::SYNTHESIZED::s:s4Int8V"
  },
  "title" : "&-=(_:_:)"
}
-->

# &-=(_:_:)

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

```
static func &-= (lhs: inout Self, rhs: Self)
```

## Parameters

`lhs`

A numeric value.

`rhs`

The value to subtract from `lhs`.

## Discussion

The masking subtraction assignment operator (`&-=`) silently wraps any
overflow that occurs during the operation. In the following example, the
difference of `10` and `21` is less than zero, the minimum representable
`UInt` value, so the result is the result is the partial value after
discarding the overflowing bits.

```
var x: Int8 = 21
x &-= 10
// x == 11
var y: UInt8 = 10
y &-= 21
// y == 245 (after overflow)
```

For more about arithmetic with overflow operators, see 
[Overflow
Operators](https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html#ID37) in *[The Swift Programming Language](https://docs.swift.org/swift-book/)*.

---

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)