• 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: Question about random number on AS 1.5.5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about random number on AS 1.5.5


  • Subject: Re: Question about random number on AS 1.5.5
  • From: Richard 23 <email@hidden>
  • Date: Mon, 26 Feb 2001 06:35:31 -0800

>No, you're reading the manual correctly. Unfortunately, the improved
>random number generator in 1.5.5 also changed the seed behavior, so the
>manual is incorrect. In 1.5.5, if you use "with seed 0", it actually
>resets the seed to zero. Also, it used to be that if you didn't supply
>a seed at all, it would use the current time as the initial seed; now it
>uses zero. I'll have to check and see whether or not this was
>deliberate.
>
>In the meantime, your best bet is to use the time as seed. In the
>startup of your script, say "random number with seed time of (current
>date)". Then use just "random number" (i.e., with no seed) when you
>need a random number.

When you guys "improved" random number (I'm assuming you don't view the
seed = zero unless one specifies a seed feature an improvement either),
did you improve the scatter of the result when the magnitude of the
input result is large?

Working on a script which deals with file/folder sizes I substituted a
random number call for the actual Finder size requests to speed up
testing.

Since it included a handler that converts sizes to a string with the
appropriate label (eg, "28 bytes", "2.1 gb", "5.2k" etc) I gave it a
big range:

random number 1.0E+14

But all of the results were between 1E+12 and 1E+14 (in the tb range).

Doesn't seem very random, the scatter I mean.

So this begs the question, just what was improved? 8)

R23


  • Follow-Ups:
    • Re: Question about random number on AS 1.5.5
      • From: Emmanuel <email@hidden>
  • Prev by Date: Selecting every item of one disk's desktop
  • Next by Date: Re: URL Access Scripting Problem
  • Previous by thread: Question about random number on AS 1.5.5
  • Next by thread: Re: Question about random number on AS 1.5.5
  • Index(es):
    • Date
    • Thread