Since calling srand in one library will affect the result of rand in all other libraries is it considered good practice to leave that responsibility to the main program? They would have a better idea of how it would affect the other libraries they are using.
In other, higher level languages random number functions returns a number from 0 (inclusive) to 1 (exclusive). With this I can create a random integer within a certain range by multiplying. In C it doesn't work this way. Instead it returns a positive signed integer. So how would I distribute this random number into a certain range? My best thought is to turn it into a fractional number first, e.g.,
r = rand() / (double)(1 + (unsigned int)RAND_MAX)
Was curious if anyone had other ideas.