Uniformly-distributed integers can be generated with the
random-mtzig:random! procedure. I do need to make the example
consistent with the API, thanks for pointing that out. Initially, the
procedures in that egg were not reentrant, and the state was global. I
forgot to update the example when I changed the procedures to have a
state variable argument. It looks like your code might work; why don't
you run it and see? Meanwhile, I will update the documentation.

        -Ivan


"Terrence Brannon" <[EMAIL PROTECTED]> writes:

>
> With your mtzig library, I see how to create a uniformly distributed
> real from (0,1)
> but I do not see how to create a uniformly distributed integer from
> [0,n) where n is some number not necessarily the largest on the
> machine.
>
> Also, i do not understand why you did not pass in the created state in
> your example at the end:
>
> csi> (require-extension random-mtzig)
> csi> (random-mtzig:init! 24)
> csi> (random-mtzig:f64vector-randu! 20)
>
> The docs say that N * state (which I assume is a 2-tuple of an integer
> and the previously created state) is passed to that function.


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to