• 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: "Arthur J Knapp" <email@hidden>
  • Date: 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... ;-)



what did he just say???


--
{
Arthur J Knapp, of STELLARViSIONs ;

http://www.STELLARViSIONs.com ;

mailto:email@hidden ;

how many?
zero.
are you sure?
i counted twice.
}


  • Follow-Ups:
    • newbie: how do you click 'ok' in as
      • From: Bret Linford <email@hidden>
    • Folder action
      • From: Amir Bozorgzadeh <email@hidden>
  • Prev by Date: Re: line breaking and indenting
  • Next by Date: A method to initialize
  • Previous by thread: Re: Rounding real numbers
  • Next by thread: Folder action
  • Index(es):
    • Date
    • Thread