function
<cstdlib>
lldivlldiv_t lldiv (long long int numer, long long int denom);
Integral division
Returns the integral quotient and remainder of the division of numer by denom (numer/denom
) as a structure of type lldiv_t, which has two members: quot and rem.
1
2
long long int quot; // quotient
long long int rem; // remainder
1
2
3
4
5
6
7
8
9
10
11
/* lldiv example */
#include <stdio.h> /* printf */
#include <stdlib.h> /* lldiv, lldiv_t */
int main ()
{
lldiv_t res;
res = lldiv (31558149LL,3600LL);
printf ("Earth orbit: %lld hours and %lld seconds.\n", res.quot, res.rem);
return 0;
}
Earth orbit: 8766 hours and 549 seconds.
If either part of the result cannot be represented, it causes undefined behavior.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4