[plt-scheme] Printing

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat Oct 15 04:17:19 EDT 2005

Matt Jadud wrote:
> You could do:
> 
> (define (decimal-places n places)
>   (* 1.0 (/ (floor (* n (expt 10 places))) (expt 10 places))))
> 
> ... or something similar. I thought there was some kind of interpolation 
> library in Planet that allowed something like your first example? (I 
> could be making that up, though.)

I am getting a deja vu.

Is this intended?

 > (decimal-places -0.04 1)
-0.1


-- 
Jens Axel Søgaard




Posted on the users mailing list.