#define RAND_MAX 0x7FFF 

Highest number that can be generated by rand().