-
Difference between revisions of "Functions HI-TECH C DIV"
From HI-TECH C for CP/M Fan WIKI(EN)
(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...") |
(No difference)
|
Latest revision as of 18:53, 31 July 2017
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;