Subject: Cormas random
From: Jean-Emmanuel Rougier (jean-emmanuel.rougier@lisode.com)
Date: Tue Aug 11 2009 - 15:53:43 CEST
Hi All,
I do apologize in advance if my question is a newbie one, but as I am
totally new in the fantastic world of Cormas…
I am using the Cormas random procedure in order to have random numbers
(yes).
So, I use exactly the formula : (Cormas random*n) truncated.
To obtain uniform distribution of random numbers from the sequence
{0,1,2,…,n-1}
Of course, as Smalltalk is full of tricks for a newcomers that comes from
C/C++, I tested it.
And some time to time I obtain n (in my tests, 3 for 1000000 calls).
Which is totally impossible.
So…
Where is the trick?
Thanks !
Jean-Emmanuel Rougier,
Associé-Gérant,
<http://www.lisode.com/> logo-lisode-petit
361 rue JF Breton
BP 5095
34196 Montpellier Cedex 5
www.lisode.com <http://www.lisode.com/>
+33 (0) 4 67 04 63 51
+33 (0) 6 62 67 51 33