Re: Random Numbers fasters than the osax
Re: Random Numbers fasters than the osax
- Subject: Re: Random Numbers fasters than the osax
- From: Arthur J Knapp <email@hidden>
- Date: Mon, 01 Apr 2002 17:48:37 -0500
>
Subject: Re: Random Numbers fasters than the osax
>
From: email@hidden (Michael Sullivan)
>
Date: Mon, 1 Apr 2002 16:42:35 -0500
>
> I am just aware that there are many different algorithms for generating
>
> random numbers, and yet it is difficult to find simple resources for
>
> these techniques that do not require a doctorate in calculus. ;-)
>
>
Number Theory is what you're looking for, actually.
But "doctorate in calculus" is a lot funner...
>
> Right, any range can be found with this type of formula:
>
>
> (R mod M) + N
>
>
> where R is a random number, M is the upper bounds, and N is the lower
>
> bounds.
>
I think you mean:
>
>
(R mod (M - N + 1)) + N
I don't think so? Can you provide an example where (R mod M) + N would
not return a number from N to M, (or why (R mod (M - N + 1)) + N is better)?
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://www.AppleScriptSourcebook.com/>
on error number -128
end try
}
_______________________________________________
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.