---
title: "/=(_:_:)"
framework: swift
role: symbol
role_heading: Operator
path: "swift/binaryinteger/_=(_:_:)-20xv1"
---

# /=(_:_:)

Divides the first value by the second and stores the quotient in the left-hand-side variable.

## Declaration

```swift
static func /= (lhs: inout Self, rhs: Self)
```

## Parameters

- `lhs`: The value to divide.
- `rhs`: The value to divide lhs by. rhs must not be zero.

## Discussion

Discussion For integer types, any remainder of the division is discarded. var x = 21 x /= 5 // x == 4

## See Also

### Arithmetic with Assignment

- [+=(_:_:)](swift/binaryinteger/+=(_:_:).md)
- [-=(_:_:)](swift/binaryinteger/-=(_:_:).md)
- [*=(_:_:)](swift/binaryinteger/*=(_:_:).md)
