Functions HI-TECH C DIV

DIV, LDIV

SYNOPSIS

#include  <stdlib.h>

div_t     div(int numer, int denom)
ldiv_t    ldiv(long numer, long denom)


DESCRIPTION

The div() function computes the quotient and remainder of the divison of numer by denom. The div() function returns a structure of type div_t, containing both the quotient and remainder. ldiv() is similar to div() except it takes arguments of type long and returns a structure of type ldiv_t. The types div_t and ldiv_t are defined in <stdlib.h> as follows:

typedef struct {
   intquot, rem;
} div_t;

typedef struct {
   longquot, rem;
} ldiv_t;