Larry Wall schreef:

> @@ -104,32 +115,34 @@
>  =item round
>
>   multi  Num::round (  Num  $x            --> Int )
> + multi  Int (  Num  $x            --> Int )
>
> -Returns the nearest integer to $x, away from zero.  In other words,
> -the absolute value, rounded up.
> +Returns the nearest integer to $x.  The algorithm is floor($x + 0.5).
> +(Other rounding algorithms will be given extended names beginning
> with "round".)

Is there also a

   multi Num::round ( Num $x, Num $d = 0 --> Num )

where $d is the number of decimals?

Maybe Num is not the right result type, think of packed/shifted decimal.

How about rounding in a different base than 10?

-- 
Grtz, Ruud

Reply via email to