Returns a tuple containing the quotient and remainder obtained by dividing the given value by this value.
Required.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
Parameters
dividend
A tuple containing the high and low parts of a double-width integer.
Return Value
A tuple containing the quotient and remainder obtained by dividing dividend
by this value.
Discussion
The resulting quotient must be representable within the bounds of the type. If the quotient is too large to represent in the type, a runtime error may occur.
The following example divides a value that is too large to be represented using a single Int
instance by another Int
value. Because the quotient is representable as an Int
, the division succeeds.