Re: Bug in StandardAdditions dictionary.
Re: Bug in StandardAdditions dictionary.
- Subject: Re: Bug in StandardAdditions dictionary.
- From: Nigel Garvey <email@hidden>
- Date: Fri, 8 Aug 2003 20:20:37 +0100
Emmanuel wrote on Fri, 8 Aug 2003 01:14:47 -0700:
>
Serge Segu has noticed a small bug that I don't remember having seen
>
mentioned here.
>
>
StandardAdditions dictionary says:
>
>
random number : Generate a random number
>
random number [ number] -- the upper limit; if not specified, result is a
>
real between 0 and 1
>
[from number] -- the lowest number to return
>
[to number] -- the greatest number to return (up to but not including)
>
>
The last sentence should read "up to, including".
It's the same in the "Standard Additions" dictionaries with OS 8.6 and
9.2.2, which also fail to mention that:
1) random number [negative number] gives a result whose *lower* limit
is the amount of the parameter - the upper being 0.
2) In the expression 'random number from a to b', it really doesn't
matter whether a or b is the lower number. 'random number from b to a'
produces the same result.
3) If one of the parameters is a real, the result will be a real.
4) 'a + (random number (b - a))' is faster than 'random number from a
to b'. Again, a and b are interchangeable.
NG
_______________________________________________
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.