• 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: Rounding real numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rounding real numbers


  • Subject: Re: Rounding real numbers
  • From: Nigel Garvey <email@hidden>
  • Date: Tue, 30 Jan 2001 19:39:32 +0000

"Arthur J Knapp" wrote on Tue, 30 Jan 2001 12:19:25 -0500:

>> Subject: Re: Rounding real numbers
>> Date: Mon, 29 Jan 2001 02:00:34 +0000
>> From: Nigel Garvey <email@hidden>
>
>> on trnc of n at d given rounding:rounding
>> tell 10 ^ d
>> tell n * it -- ie. n * (10 ^ d)
>> if rounding then
>> it div 0.5 - it div 1 -- round to nearest
>> else
>> it div 1 -- or truncate
>> end if
>> end tell
>> result / it -- return the result divided by (10 ^ d)
>> end tell
>> end trnc
>>
>> trnc of 6.022548445 at 2 with rounding
>> --> 6.02
>
>
> Using an osax-defined parameter keyword as a vanilla
>handler parameter is pretty darn naughty... ;-)
>

I expect it is. But why quote my handler to say that? Do you have an OSAX
with the keywords n or d? {8-|

NG


  • Prev by Date: Re: line breaking and indenting
  • Next by Date: Re: AS for dummies
  • Previous by thread: Re: Rounding real numbers
  • Next by thread: Smile
  • Index(es):
    • Date
    • Thread