I need to generate random numbers within a specified interval, [max;min].
Also, the random numbers should be uniformly distributed over the interval, not located to
Check what RAND_MAX is on your system -- I'm guessing it is only 16 bits, and your range is too big for it.
RAND_MAX
Beyond that see this discussion on: Generating Random Integers within a Desired Range and the notes on using (or not) the C rand() function.