| www.delorie.com/djgpp/doc/libc-2.01/libc_444.html | search |
#include <stdlib.h> lldiv_t lldiv(long long numerator, long long denomonator);
Returns the quotient and remainder of the division numberator divided by denomonator. The return type is as follows:
typedef struct {
long long quot;
long long rem;
} lldiv_t;
The results of the division are returned.
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 }
Go to the first, previous, next, last section, table of contents.
| prev next webmaster | delorie software privacy |
| Copyright © 1997 | Updated Apr 1997 |