User manual

Table Of Contents
618
mikoC PRO for PIC32
MikroElektronika
min
Prototype
int min(int a, int b);
Description Function returns lower of the two integers, a and b.
Example
result = min(123,67); // function returns 67
rand
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.
Example
while(1)
result = rand()
;
srand
Prototype
void srand(unsigned x);
Description Function uses x as a starting point for a new sequence of pseudo-random numbers to be returned by
subsequent calls to rand. No values are returned by this function.
Example
srand(9);
xtoi
Prototype
unsigned xtoi(char *s);
Description Function converts the input string s consisting of hexadecimal digits into an integer value. The input
parameter s should consist exclusively of hexadecimal digits, with an optional whitespace and a sign
at the beginning. The string will be processed one character at a time, until the function reaches a
character which it doesn’t recognize (including a null character).
Example
result = xtoi(“1FF”); // result = 511