Re: Rounding real numbers
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