Converts max to an integer using max1 = max.to_i.abs. If the
result is zero, returns a pseudorandom floating point number greater than
or equal to 0.0 and less than 1.0. Otherwise, returns a pseudorandom
integer greater than or equal to zero and less than max1. Kernel::srand may
be used to ensure repeatable sequences of random numbers between different
runs of the program. Ruby currently uses a modified Mersenne Twister with a
period of 2**19937-1.