• 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: Highlights of AppleScript 1.5.5 in Mac OS 9.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
      • From: Timothy Bates <email@hidden>
  • Prev by Date: getting OS 9.1
  • Next by Date: Re: Getting OS 9.1
  • Previous by thread: Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
  • Next by thread: Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
  • Index(es):
    • Date
    • Thread