443
edits
-
Changes
Created page with "<strong>DIV, LDIV</strong> ==SYNOPSIS== #include <stdlib.h> div_t div(int numer, int denom) ldiv_t ldiv(long numer, long denom) ==DESCRIPTION== The <strong>div..."
<strong>DIV, LDIV</strong>
==SYNOPSIS==
#include <stdlib.h>
div_t div(int numer, int denom)
ldiv_t ldiv(long numer, long denom)
==DESCRIPTION==
The <strong>div</strong>() function computes the quotient and remainder
of the divison of numer by denom. The <strong>div</strong>() function
returns a structure of type div_t, containing both the
quotient and remainder. <strong>ldiv</strong>() is similar to <strong>div</strong>()
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;
==SYNOPSIS==
#include <stdlib.h>
div_t div(int numer, int denom)
ldiv_t ldiv(long numer, long denom)
==DESCRIPTION==
The <strong>div</strong>() function computes the quotient and remainder
of the divison of numer by denom. The <strong>div</strong>() function
returns a structure of type div_t, containing both the
quotient and remainder. <strong>ldiv</strong>() is similar to <strong>div</strong>()
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;