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: "Arthur J Knapp" <email@hidden>
- Date: Wed, 10 Jan 2001 10:52:35 -0500
>
Subject: Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
>
Date: Tue, 9 Jan 2001 23:55:39 +0000
>
From: Nigel Garvey <email@hidden>
>
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?
No, it's American, the update to English. ;-)
>
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
Wow, these are great. I wish I could get a handle on exactly what
the IEEE standard is trying to accomplish, (I'm pretty thick when
it comes to math). :)
There are a lot of instances of where scripting additions are
considerably slower than "native" AppleScript code. I often don't
understand what the point of the Apple-provided osaxen is for. If
the AppleScript team wants to implement a rounding command, why
not just build it into the core language?
>
NG
and "NG" shall be our battle cry...
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
"... but I could be anyone"
"No you couldn't, sir ..."
}