|Anonymous | Login||08-10-2020 02:52 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0003473||[Squeak] Kernel||minor||always||04-16-06 01:05||04-17-06 20:22|
|Summary||0003473: class Random quirks (bugs really)|
The documentation in class Random method #nextValue states:
"This method generates random instances of Integer
in the interval 0 to 16r7FFFFFFF."
In fact, it generates floats.
One possible fix is to change the comment but #nextValue
is a low level private method and as such it should generate small integers.
A second problem is that if the result of #nextValue is converted to an
integer it is a large integer about half the time.
Also, Class Random should ideally have a public method #nextInteger,
which if called enough times, generates all small integers in some random order.
I need such a method for my application.
(I use them as hash values for objects.)
Class random has a method #nextInt: which generates random integers in a
range. This method should only use small integers, never floats as it does
A final comment:
When Squeak begins to run on 64 bit machines it will need to support
a version of Random in which random numbers in the range supported by 64 bit
squeak are generated.
|There are no notes attached to this issue.|
|04-16-06 01:05||rpboland||New Issue|
|04-16-06 01:05||rpboland||Status||new => assigned|
|04-16-06 01:05||rpboland||Assigned To||=> KenCausey|
|04-17-06 20:22||KenCausey||Assigned To||KenCausey =>|
|04-17-06 20:22||KenCausey||Status||assigned => new|
|04-17-06 20:22||KenCausey||Category||Any => Kernel|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
33 total queries executed.|
28 unique queries executed.