New Random Number Generator

Tim Rowledge tim at sumeru.stanford.edu
Mon Jul 29 15:32:54 UTC 2002


"Richard A. O'Keefe" <ok at cs.otago.ac.nz> is claimed by the authorities to have written:

> The random number generator is a strong candidate for being a plugin.
I would agree; it's simple code, it has no complicated return values, it
would benefit from trivial access to unsigned(!) and whenever I want
random numbers I seem to need them rapidly. A plugin would cover it
nicely.

And Mark said:
>The information about the different way that Squeak and C handle unsigned 
>long integers in shift operations was interesting but amazingly it made no 
>difference in the outcome
Hmm. Have you compiled the C code and tested it? Just in case... it
wouldn't be the first time that demo C code had some subtle mis-print in
it.

To check further, knock up a little C prog to take a few numbers and do
the various shifts/masks, and some Squeak code to do the same. Compare;
it should at least illustrate where the differences are creeping in ot
bite you. Chances are good that it is a single trivial typo-like error
somewhere.

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: SG: Show Garbage




More information about the Squeak-dev mailing list