[Cuis-dev] Random fixes

Luciano Notarfrancesco luchiano at gmail.com
Wed Jun 5 22:55:25 PDT 2019


This changeset fixes an infinite loop when doing:
  Random new nextInteger: 0

It also allows to use any integer as seed to initialize a new Random, so
you can do something like:
  Random seed: 12938479182374979182734987
without making assumptions about the particular implementation of Random
that will be created. The new ParkMiller88Random will be initialized
exactly as before if the seed is in the originally expected range (keeping
backwards compatibility); but if the seed is not in that range, now it will
initialize the generator with a valid seed derived from the user-provided
seed, instead of raising an exception.

The changeset also adds a method Random>>nextBoolean that returns true or
false.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190606/c27d8740/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3785-RandomFixes-LucianoEstebanNotarfrancesco-2019Jun06-05h46m-len.1.cs.st
Type: application/vnd.sailingtracker.track
Size: 730 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190606/c27d8740/attachment.bin>


More information about the Cuis-dev mailing list