Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

lldiv - Division with integers (long long int)

&pagelevel(4)&pagelevel

Definition  

#include <stdlib.h>

lldiv_t lldiv(long long int dividend, long long int divisor);

lldiv calculates the quotient and the remainder of the division of dividend by divisor.
Both the arguments and the result are of type long long int.

The sign of the quotient is the same as the sign of the algebraic quotient. The value of the quotient is the highest integer less than or equal to the absolute value of the algebraic quotient.

The remainder is expressed by the following equation:

Quotient * Divisor + Remainder = Dividend

Return val.

Structure of type lldiv_t

containing both the quotient quot and the remainder rem as integer values.

Example

See also

see ldiv.

div, ldiv