OperatorSwift

/(_:_:)

Returns the quotient of dividing the first value by the second.

static func / (lhs: Int, rhs: Int) -> Int

Parameters

lhs

The value to divide.

rhs

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

Overview

For integer types, any remainder of the division is discarded.

let x = 21 / 5
// x == 4