2008/7/26 Anye Li <[EMAIL PROTECTED]>:
> Even if it is not a bug that rationalize returns inexact results (surprising
> and useless as they may be to me), I believe it is still a bug that (help
> rationalize) says "Return an exact number..." when in fact it does not.
Agreed. I'm just fixing this now, to make (help rationalize) say the
same as the Guile manual says:
Returns the @emph{simplest} rational number differing
from @var{x} by no more than @var{eps}.
As required by @acronym{R5RS}, @code{rationalize} only returns an
exact result when both its arguments are exact. Thus, you might need
to use @code{inexact->exact} on the arguments.
@lisp
(rationalize (inexact->exact 1.2) 1/100)
@result{} 6/5
Regards,
Neil