On 09/11/03 07:49 AM, [EMAIL PROTECTED] wrote:

> 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.

Likely this is neither a Perl issue nor a M$oft issue. The same problem
arises in C implementations. A common reason for getting different results
has to do with whether or not the microprocessor is BIG-endian or
little-endian.
 
>> Is there another random library routine designed to be independent
>> from Micros--t shenanigans ?

What you need is a *portable* RNG. See Perl code in my other email.


--njg

___________________________________________________________________________

PERFORMANCE DYNAMICS COMPANY(sm)              http://www.perfdynamics.com/
___________________________________________________________________________

Consulting Services                           Educational Services
4061 East Castro Valley Blvd.                 P.O. Box 1238, Magalia
Suite 110, Castro Valley                      California 95954, USA
California 94552, USA                         Bookings and registrations
FON: +1-510-537-5758                          FON: +1-530-873-0575
FAX: Dial FON (Handshakes automagically)      FAX: +1-530-873-6697
NET: [EMAIL PROTECTED]                    NET: [EMAIL PROTECTED]
___________________________________________________________________________


Reply via email to