unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Neil Jerram" <neiljerram@googlemail.com>
To: "Anye Li" <li.anye.0@gmail.com>
Cc: bug-guile@gnu.org
Subject: Re: rationalize returns inexact results.
Date: Sun, 3 Aug 2008 00:24:12 +0100	[thread overview]
Message-ID: <49dd78620808021624y4c390749j56a571853e69ccdb@mail.gmail.com> (raw)
In-Reply-To: <488AB87A.8050701@gmail.com>

2008/7/26 Anye Li <li.anye.0@gmail.com>:
> 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




  reply	other threads:[~2008-08-02 23:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26  5:39 rationalize returns inexact results Anye Li
2008-08-02 23:24 ` Neil Jerram [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-25 17:33 Bill Schottstaedt
2008-07-24  5:15 Anye Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49dd78620808021624y4c390749j56a571853e69ccdb@mail.gmail.com \
    --to=neiljerram@googlemail.com \
    --cc=bug-guile@gnu.org \
    --cc=li.anye.0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).