[Cuis-dev] Random fixes

Hernan Wilkinson hernan.wilkinson at 10pines.com
Thu Jun 6 11:54:55 PDT 2019


Hi Luciano,
 there are three tests that fail when running the RandomTest of the
BaseImageTests.pck.st
 In reality, it is the same test, testSeed0 for the different Random
implementations, that expects to fail when the seed is 0 and it does not.
 I'm not an expert on the matter so I'm not sure the test is correct or
wrong. I presume you change allow a seed to be 0, something not allowed
before, but could you take a look at it and fix what it is necessary (the
test or your change).
 Let me know and I'll integrate it after.

Thanks!
Hernan.

On Thu, Jun 6, 2019 at 2:51 AM Luciano Notarfrancesco via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> 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.
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*HernĂ¡n WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190606/1ea0b4fc/attachment.html>


More information about the Cuis-dev mailing list