[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [plt-scheme] Printing
From:       mcj4 () kent ! ac ! uk (Matt Jadud)
Date:       2005-10-15 8:34:31
Message-ID: 4350BF17.3000007 () kent ! ac ! uk
[Download RAW message or body]

I'd like to remind everyone that, had I learned my lessons, I would have

1. First written a contract and purpose statement.
2. A header.
3. Test cases.
4. The code.

Alas, I have not followed the One True Way.

:(

M

PS. Ouch. You got me. I can just about see Bart Simpson writing "I will 
not write Scheme code first thing in the morning" over and over right 
now. :)

Jens Axel S?gaard wrote:
> 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
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic