From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Bill Schottstaedt" Newsgroups: gmane.lisp.guile.bugs Subject: Re: rationalize returns inexact results. Date: Fri, 25 Jul 2008 10:33:45 -0700 Message-ID: <20080725172949.M14171@ccrma.Stanford.EDU> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: ger.gmane.org 1217007244 32492 80.91.229.12 (25 Jul 2008 17:34:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2008 17:34:04 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jul 25 19:34:54 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KMRBt-00057K-6V for guile-bugs@m.gmane.org; Fri, 25 Jul 2008 19:34:53 +0200 Original-Received: from localhost ([127.0.0.1]:59091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMRAz-0008T4-GS for guile-bugs@m.gmane.org; Fri, 25 Jul 2008 13:33:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KMRAw-0008So-2c for bug-guile@gnu.org; Fri, 25 Jul 2008 13:33:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KMRAs-0008SV-G1 for bug-guile@gnu.org; Fri, 25 Jul 2008 13:33:52 -0400 Original-Received: from [199.232.76.173] (port=35283 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMRAs-0008SR-6w for bug-guile@gnu.org; Fri, 25 Jul 2008 13:33:50 -0400 Original-Received: from smtp3.stanford.edu ([171.67.20.26]:54974) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KMRAr-0000Mz-K3 for bug-guile@gnu.org; Fri, 25 Jul 2008 13:33:49 -0400 Original-Received: from smtp3.stanford.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 5C91E60E9C1 for ; Fri, 25 Jul 2008 10:33:48 -0700 (PDT) Original-Received: from cm-mail.stanford.edu (cm-mail.Stanford.EDU [171.64.197.135]) by smtp3.stanford.edu (Postfix) with ESMTP id 2BD9960EB7A for ; Fri, 25 Jul 2008 10:33:47 -0700 (PDT) Original-Received: from ccrma.stanford.edu (ccrma.stanford.edu [171.64.197.141]) by cm-mail.stanford.edu (8.13.8/8.13.8) with ESMTP id m6PHXjnc017499 for ; Fri, 25 Jul 2008 10:33:45 -0700 Original-Received: from ccrma.Stanford.EDU (localhost.localdomain [127.0.0.1]) by ccrma.stanford.edu (8.12.11.20060308/8.12.5) with ESMTP id m6PHXjgc007939 for ; Fri, 25 Jul 2008 10:33:45 -0700 X-Mailer: Open WebMail 2.41 20040926 X-OriginatingIP: 67.161.21.103 (bil) X-Virus-Scanned: ClamAV 0.92.1/7826/Fri Jul 25 05:51:06 2008 on cm-mail.stanford.edu X-Virus-Status: Clean X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3946 Archived-At: > 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