Operator

/(_:_:)

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

Declaration

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.

Discussion

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

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

Relationships

From Protocol

See Also

Arithmetic

static func + (Int, Int) -> Int

Adds two values and produces their sum.

static func - (Int, Int) -> Int

Subtracts one value from another and produces their difference.

static func * (Int, Int) -> Int

Multiplies two values and produces their product.

static func % (Int, Int) -> Int

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