Mantis Bugtracker

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
Reporter rpboland View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.8
Summary 0003473: class Random quirks (bugs really)
Description 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.
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
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.
Powered by Mantis Bugtracker