• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Random Numbers fasters than the osax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Random Numbers fasters than the osax
      • From: email@hidden (Michael Sullivan)
  • Prev by Date: RE: SQL database and applescript?
  • Next by Date: Re: batch inport to FMP
  • Previous by thread: Vanilla random number generator to applemods (was Re: Random Numbers...)
  • Next by thread: Re: Random Numbers fasters than the osax
  • Index(es):
    • Date
    • Thread