-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
b61
-
x86
-
windows_xp
Name: rmT116609 Date: 03/05/2003
DESCRIPTION OF THE PROBLEM :
Documentation of nextDouble() in java.util.Random contains
the sentence:
"All 2^53 possible float values of the form m x 2^-53 ,
where m is a positive integer less than 2^53, are produced
with (approximately) equal probability."
I believe this statement is incorrect, and also contains a
typo.
As Random uses only a 48-bit seed, the number of different
values of a given type that may be produced is clearly
bounded by 2^48. Hence only 2^48 different doubles can be
returned, which is only 1/32 of the claimed range.
The "approximately" does not (IMHO) absorb the error, as
{2^-48, 0, 0, 0, ..... 0, 0} is nothing like {2^-53, 2^-53,
2^-53, 2^-53, .... 2^-53, 2^-53}.
Also, the word "float" is used where "double" is probably
intended.
REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 180209)
======================================================================
DESCRIPTION OF THE PROBLEM :
Documentation of nextDouble() in java.util.Random contains
the sentence:
"All 2^53 possible float values of the form m x 2^-53 ,
where m is a positive integer less than 2^53, are produced
with (approximately) equal probability."
I believe this statement is incorrect, and also contains a
typo.
As Random uses only a 48-bit seed, the number of different
values of a given type that may be produced is clearly
bounded by 2^48. Hence only 2^48 different doubles can be
returned, which is only 1/32 of the claimed range.
The "approximately" does not (IMHO) absorb the error, as
{2^-48, 0, 0, 0, ..... 0, 0} is nothing like {2^-53, 2^-53,
2^-53, 2^-53, .... 2^-53, 2^-53}.
Also, the word "float" is used where "double" is probably
intended.
REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 180209)
======================================================================