Why don't you use one of the algorithms that give 52 or 63 bits resolution? Make sure your results are stored with double or long double precision so you don't loose information somewhere in your code. (Microsoft compilers don't support long double). With a resolution of 32 bits, you can get any value by chance within a reasonable time. With 52 bits or more you can not. Even though it is possible to represent extremely small values 2^(-x) in a float or double or long double, it's not possible to store the value 1-2^(-x). A random number generator that can generate 2^(-x) but not 1-2^(-x) will obviously not have a perfect uniform distribution. Therefore, x is limited by the resolution, not the range. |