Re: Random Numbers fasters than the osax
Re: Random Numbers fasters than the osax
- Subject: Re: Random Numbers fasters than the osax
- From: Emmanuel <email@hidden>
- Date: Sun, 31 Mar 2002 09:08:43 +0200
At 1:21 AM +0200 30/3/02, Arthur J Knapp wrote:
>
>
I would really appreciate it if someone could point me in the
>
direction of some simple pseudo code for RNGs, (as opposed to
>
platform-optimized implementations or complex mathematical theses).
I'm surely missing something, but what's wrong with the suggestion I
presented 3 days ago?
>
------------------------
>
set theNextRandomNumber to (thePreviousOne + BigBigPrime) mod (BigPrime)
>
------------------------
>
>
where BigPrime is any big prime number, and BigBigPrime a still bigger one.
(if you're looking for integer random numbers, then BigPrime must be
something like your range of values - not a prime number then)
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.