Datasheet
uldiv
labs
max
min
rand
srand
552
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
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 denom-
inator denom; the function returns a structure of type uldiv_t comprising quo-
tient (quot) and remainder (rem), see Div Structures.
Prototype
long labs(long x);
Description Function returns the absolute (i.e. positive) value of long integer x.
Prototype
int max(int a, int b);
Description Function returns greater of the two integers, a and b.
Prototype
int min(int a, int b);
Description Function returns lower of the two integers, a and b.
Prototype
int rand();
Description
Function returns a sequence of pseudo-random numbers between 0 and 32767.
The function will always produce the same sequence of numbers unless srand
is called to seed the start point.
Prototype
void srand(unsigned x);
Description
Function uses x as a starting point for a new sequence of pseudo-random num-
bers to be returned by subsequent calls to rand. No values are returned by this
function.