From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Llorens Newsgroups: gmane.lisp.guile.bugs Subject: bug#13905: (max inexact exact) => always inexact? Date: Fri, 8 Mar 2013 13:43:15 +0100 Message-ID: <75E5F130-E4B6-49CF-9937-CF2D153B494C@bluewin.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1362746675 28294 80.91.229.3 (8 Mar 2013 12:44:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Mar 2013 12:44:35 +0000 (UTC) To: 13905@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 08 13:44:57 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UDwfR-0005Dg-9L for guile-bugs@m.gmane.org; Fri, 08 Mar 2013 13:44:57 +0100 Original-Received: from localhost ([::1]:48816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDwf5-0000mN-D2 for guile-bugs@m.gmane.org; Fri, 08 Mar 2013 07:44:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDwew-0000ls-L9 for bug-guile@gnu.org; Fri, 08 Mar 2013 07:44:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDwev-0002gQ-1b for bug-guile@gnu.org; Fri, 08 Mar 2013 07:44:26 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDweu-0002gJ-Uf for bug-guile@gnu.org; Fri, 08 Mar 2013 07:44:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UDwfV-0005Ql-Qj for bug-guile@gnu.org; Fri, 08 Mar 2013 07:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Llorens Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 08 Mar 2013 12:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13905 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136274665420802 (code B ref -1); Fri, 08 Mar 2013 12:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Mar 2013 12:44:14 +0000 Original-Received: from localhost ([127.0.0.1]:38428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDwei-0005PS-Dw for submit@debbugs.gnu.org; Fri, 08 Mar 2013 07:44:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55968) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDweg-0005PD-IC for submit@debbugs.gnu.org; Fri, 08 Mar 2013 07:44:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDwdy-0002Wi-J9 for submit@debbugs.gnu.org; Fri, 08 Mar 2013 07:43:28 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:58347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDwdy-0002Wd-GZ for submit@debbugs.gnu.org; Fri, 08 Mar 2013 07:43:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDwdw-0000FG-4V for bug-guile@gnu.org; Fri, 08 Mar 2013 07:43:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDwds-0002W1-5U for bug-guile@gnu.org; Fri, 08 Mar 2013 07:43:24 -0500 Original-Received: from zhhdzmsp-smta16.bluewin.ch ([195.186.227.132]:39933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDwdr-0002Vd-W0 for bug-guile@gnu.org; Fri, 08 Mar 2013 07:43:20 -0500 Original-Received: from [195.186.99.131] ([195.186.99.131:45085] helo=zhbdzmsp-smta13.bluewin.ch) by zhhdzmsp-smta16.bluewin.ch (envelope-from ) (ecelerity 2.2.3.47 r(39824M)) with ESMTP id F2/CD-25143-4ECD9315; Fri, 08 Mar 2013 12:43:17 +0000 Original-Received: from [172.16.96.17] (62.2.203.131) by zhbdzmsp-smta13.bluewin.ch (8.5.142) (authenticated as dll@bluewin.ch) id 5100862203D701EE for bug-guile@gnu.org; Fri, 8 Mar 2013 12:43:16 +0000 X-Mailer: Apple Mail (2.1085) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6883 Archived-At: Not necessarily a bug, but I'd like to hear some thoughts on this. In current Guile (max -inf.0 9) =3D> 9.0 The manual says > R5RS requires that, with few exceptions, a calculation involving = inexact numbers always produces an inexact result [...] The only = exception to the above requirement is when the values of the inexact = numbers do not affect the result. For example (expt n 0) is =911=92 for = any value of n, therefore (expt 5.0 0) is permitted to return an exact = =911=92. In fact, in current Guile (expt 5.0 0) =3D> 1 although (!) (* -1.0 0) =3D> 0.0 Anyway. R5RS says specifically for max / min > If any argument is inexact, then the result will also be inexact = (unless the procedure can prove that the inaccuracy is not large enough = to affect the result, which is possible only in unusual = implementations). Certainly, there are calculations that return -inf.0 when done with = inexact arithmetic that would have returned {hugely negative exact = number} if done with exact arithmetic. In this sense, the condition = above doesn't hold. That doesn't justify (max -inf.0 9) =3D> 9.0 either, = of course. My interest in this is that I don't want (fold max -inf.0 exact-number-list) to return an inexact number. I also find inconvenient that max doesn't = return one of its arguments even though there's no NaN involved. I've checked mzscheme and it does as Guile here. Regards Daniel