unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Bill Schottstaedt" <bil@ccrma.Stanford.EDU>
To: bug-guile@gnu.org
Subject: Re: rationalize returns inexact results.
Date: Fri, 25 Jul 2008 10:33:45 -0700	[thread overview]
Message-ID: <20080725172949.M14171@ccrma.Stanford.EDU> (raw)

> Since Guile now supports exact rationals, shouldn't it return an exact result?

I actually agree with you (I implemented rationalize in Guile, and originally
it always returned a ratio -- why else call it "rationalize"?), but Marius
pointed out that R5RS says "With the exception of inexact->exact, the 
operations described in this section must generally return inexact results
when given any inexact arguments" in the section including rationalize.
I doubt that R6RS fixed this bug.  So, to get an exact result you need to
give exact arguments:

guile> (rationalize (inexact->exact .33) 1/10)
1/3






             reply	other threads:[~2008-07-25 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 17:33 Bill Schottstaedt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-26  5:39 rationalize returns inexact results Anye Li
2008-08-02 23:24 ` Neil Jerram
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=20080725172949.M14171@ccrma.Stanford.EDU \
    --to=bil@ccrma.stanford.edu \
    --cc=bug-guile@gnu.org \
    /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).