Raul,

No, that LCG does not do well for the bsd version (the ms version only has
32,000 numbers it can generate, so it is impractical, but works as needed).
Consider the two examples below, one on J602 and one on J701. Judging by
the how the first few numbers do work, it may by possible to fix by just
adding precision to the algorithm, though.

Thank you,

J602:


   x: rand_bsd 10
12345 1406932606 654583808 1358247936 2138638336 1459132416 1445521408
370866176 1896597568 1518859008

J701:

   rand_bsd 10
12345 1406932606 654583775 1449466924 229283573 1109335178 1051550459
1293799192 794471793 551188310






On Fri, Jan 24, 2014 at 9:58 AM, Raul Miller <[email protected]> wrote:

> Would http://rosettacode.org/wiki/Linear_congruential_generator#J
> satisfy your need for a "portable" "RNG" or do you have deeper needs?
>
> Thanks,
>
> --
> Raul


-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to