home *** CD-ROM | disk | FTP | other *** search
- @node lldiv, math
- @subheading Syntax
-
- @example
- #include <stdlib.h>
-
- lldiv_t lldiv(long long numerator, long long denomonator);
- @end example
-
- @subheading Description
-
- Returns the quotient and remainder of the division @var{numberator}
- divided by @var{denomonator}. The return type is as follows:
-
- @example
- typedef struct @{
- long long quot;
- long long rem;
- @} lldiv_t;
- @end example
-
- @subheading Return Value
-
- The results of the division are returned.
-
- @subheading Example
-
- @example
- lldiv_t l = lldiv(42, 3);
- printf("42 = %lld x 3 + %lld\n", l.quot, l.rem);
-
- lldiv(+40, +3) = @{ +13, +1 @}
- lldiv(+40, -3) = @{ -13, -1 @}
- lldiv(-40, +3) = @{ -13, -1 @}
- lldiv(-40, -3) = @{ +13, -1 @}
-
- @end example
-
-