10 Mar
2015
10 Mar
'15
10:29 a.m.
Il giorno martedì 10 marzo 2015 11:14:26 UTC+1, Thorsten Ottosen ha scritto:
Given a random double in some interval, would it be possible to calculate the nearest rational number?
there's no nearest rational number, as there are inifinetly many of them in any bounded neighbourhood of any real number. Unless by nearest you mean the nearest rational with the greatest representable denominator... but in this case the result will not be uniform anymore. As said, uniformity ( meaning prob(x in [a,b])=b-a ) seems fundamentally impossible for rationals for the aforementioned reasons ...