|
leapc
|
Quotient and modulus prototypes. More...

Go to the source code of this file.
Data Structures | |
| struct | quo_mod |
| Quotient and remainder in integer space. More... | |
Functions | |
| struct quo_mod | quo_mod (int x, int y) |
| Compute the integer quotient and modulus. | |
Quotient and modulus prototypes.
Header file for quotient and modulus function implementations.
Definition in file quo_mod.h.
Compute the integer quotient and modulus.
Performs an integer modulo operation. Then subtracts the modulus from the numerator and applies an integer division in order to compute the quotient.
The following invariant proves true: the numerator matches the denominator multiplied by the quotient plus the modulus.
| x | Numerator integer. |
| y | Denominator integer. Must not be zero. |
quo_mod structure comprising the quotient and modulus. quo_mod identifier exists in structure namespace as well as function namespace. y is zero.