LLDIV(3)

NAME
lldiv - divide two long long integers

SYNOPSIS

#include <stdlib.h>

lldiv_t lldiv(long long n, long long d);

DESCRIPTION

Divide n/d, returning quotient and remainder as two long long integers in a structure lldiv_t.

RETURNS

The result is represented with the structure

     typedef struct
     {
      long long quot;
      long long rem;
     } lldiv_t;

where the quot field represents the quotient, and rem the remainder. For nonzero d, if `r = ldiv(n,d);' then n equals `r.rem + d*r.quot'.

To divide long rather than long long values, use the similar function ldiv.

PORTABILITY

lldiv is ISO 9899 (C99) compatable.

No supporting OS subroutines are required.