Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
- Subject: Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
- From: Nigel Garvey <email@hidden>
- Date: Tue, 9 Jan 2001 23:55:39 +0000
Chris Espinosa wrote on Tue, 09 Jan 2001 14:43:14 -0800:
>
ROUND LIKE TAUGHT IN SCHOOL
Urghh! That's even worse than the promised 'as taught in school'! Is that
"International English", perhaps?
If it's as fast as the current 'round', it'll still be seventeen times
quicker to use a handler:
on rnd(n)
n div 0.5 - n div 1
end
on rndIEEE(n)
if (n mod 2) ^ 2 > 0.25 then return n div 0.5 - n div 1
n div 1
end rndIEEE
rnd(122.5)
--> 123
rndIEEE(122.5)
--> 122
NG