guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ratio implementation


From: Bill Schottstaedt
Subject: Re: ratio implementation
Date: Tue, 29 Jul 2003 04:57:33 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Kevin Ryde wrote:

I notice that r5rs seems to
imply that (inexact->exact .3) should return 3/10 (see the rationalize
example which is assuming this)

Isn't that the effect of the rationalize function, rather than
inexact->exact?
The example I was referring to was:

(rationalize
 (inexact->exact .3) 1/10)            ==> 1/3    ; exact


which only makes sense if (inexact->exact .3) does not
return 0, but 3/10.  Then rationalize of that with an
error of 1/10 finds the simpler ratio 1/3. In Guile
currently (I'm typing from work, so I can't actually
check this...), the (inexact->exact .3) returns 0,
so rationalize would also return 0.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]