Is this s Perl random function? If so, I would complain to those that ported it.

In any case, you could write your own randomizer as:

   S' = A * S mod P
   R = S' / N

Where:
  S = seed,
  A = const 16807
  P = const 2**31 - 1,
  N = scale, random number R returned between 0 : N-1


I have been using this for decades in various forms on a wide variety of platforms. Results are the same for any given platform...


At 11:04 +0200 09/11/2003, Louis Pouzin wrote:
Hi,

In a script intended for mac, unix and windows platforms, I use the "rand" function. It is essential that it produces the same sequence on all three platforms. This is the case with mac and unix. On windows, it's a completely different set.

Is there another random library routine designed to be independent from Micros--t shenanigans ?

Thanks



Reply via email to