Returns the remainder of dividing the first value by the second.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
Parameters
lhs
The value to divide.
rhs
The value to divide
lhs
by.rhs
must not be zero.
Discussion
The result of the remainder operator (%
) has the same sign as lhs
and has a magnitude less than rhs
.
For any two integers a
and b
, their quotient q
, and their remainder r
, a == b * q + r
.