Hi Jimmie,

the key is to use the '*/' function for both multiplication and division.
'*' is not very useful here.

> : (format (* 9.9 9.789 9.56789) 20)
> -> "9272347445790000000000000000000000000000000.00000000000000000000"

Instead, try

   : (scl 20)
   -> 20

   : (format (*/ 9.9 9.789 9.56789 `(* 1.0 1.0)) *Scl)
   -> "927.23474457900000000000"

or

   : (round (*/ 9.9 9.789 9.56789 `(* 1.0 1.0)))
   -> "927.235"

   : (round (*/ 9.9 9.789 9.56789 `(* 1.0 1.0)) 7)
   -> "927.2347446"


> So in the example below I would have to track the number of arguments to the
> * function. Then multiple that number against the current Scl value. In the

Yes. Perhaps you could look at the flight simulator in "misc/rcsim.l" in the
PicoLisp distribution. It defines a read macro MUL to keep track of the number
of multiplications.

♪♫ Alex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to