Can an IEEE-754 floating point number < 1 (i.e. generated with a random number generator which generates a number >= 0.0 and < 1.0) ever be multiplied by some integer (in floating point form) to get a number equal to or larger than that integer due to rounding?
i.e.
double r = random() ; // generates a floating point number in [0, 1)
double n = some_int ;
if (n * r >= n) {
print 'Rounding Happened' ;
}
This might be equivalent to saying that does there exist an N and R such that if R is the largest number less than 1 which can be represented in IEEE-754 then N * R >= N (where * and >= are appropriate IEEE-754 operators)
This comes from this question based on this documentation and the postgresql random function