How can I pick a random number from the following set:
- All positive integers that can be represented exactly by a double precision floating point number (i.e. a Java
double
).
Distribution
In my particular use case, I don't need uniform distribution. I am, however, academically interested in such a solution. Also, uniform could be interpreted in (at least) 2 different ways:
- The distribution is uniform in [0, Double.MAX_VALUE].
- The probability of picking each possible value is equal.