User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
617
ldiv
Prototype
ldiv_t ldiv(long number, long denom);
Description Function is similar to the div function, except that the arguments and result structure members all have
type long.
Function computes the result of division of the numerator number by the denominator denom; the
function returns a structure of type ldiv_t comprising quotient (quot) and remainder (rem), see Div
Structures.
Example
dl = ldiv(-123456, 1000);
uldiv
Prototype
uldiv_t uldiv(unsigned long number, unsigned long denom);
Description Function is similar to the div function, except that the arguments and result structure members all have
type unsigned long.
Function computes the result of division of the numerator number by the denominator denom; the
function returns a structure of type uldiv_t comprising quotient (quot) and remainder (rem), see
Div Structures.
Example
dul = uldiv(123456,1000);
labs
Prototype
long labs(long x);
Description Function returns the absolute (i.e. positive) value of long integer x.
Example
result = labs(-2147483647);
max
Prototype
int max(int a, int b);
Description Function returns greater of the two integers, a and b.
Example
result = max(123,67); // function returns 123