Returns the remainder of this value divided by the given value.
- Xcode 9.0+
- Swift Standard Library
The value to use when dividing this value.
The remainder of this value divided by
For two finite values
y, the remainder
r of dividing
x == y * q + r, where
q is the integer nearest to
x / y. If
x / y is exactly halfway between two integers,
q is chosen to be even. Note that
q is not
x / y computed in floating-point arithmetic, and that
q may not be representable in any available integer type.
The following example calculates the remainder of dividing 8.625 by 0.75:
If this value and
other are finite numbers, the remainder is in the closed range
-abs(other / 2)...abs(other / 2). The
remainder(dividing method is always exact. This method implements the remainder operation defined by the IEEE 754 specification.