From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Fix bugs in expt and integer-expt Date: Wed, 10 Nov 2010 23:01:16 +0100 Message-ID: <87sjz8yh1v.fsf@gnu.org> References: <8762whnc4d.fsf@yeeloong.netris.org> <87r5f4l3yt.fsf@yeeloong.netris.org> <87aalrxim7.fsf@yeeloong.netris.org> <87wrouwf6b.fsf@yeeloong.netris.org> <87bp66rns2.fsf@gnu.org> <87k4ksv7gl.fsf_-_@yeeloong.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1289426532 23864 80.91.229.12 (10 Nov 2010 22:02:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 10 Nov 2010 22:02:12 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Nov 10 23:02:06 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PGIk2-0000P8-Fk for guile-devel@m.gmane.org; Wed, 10 Nov 2010 23:02:06 +0100 Original-Received: from localhost ([127.0.0.1]:36565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGIk2-0000Ip-2v for guile-devel@m.gmane.org; Wed, 10 Nov 2010 17:02:06 -0500 Original-Received: from [140.186.70.92] (port=46550 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGIjw-0000Hc-0J for guile-devel@gnu.org; Wed, 10 Nov 2010 17:02:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGIju-0003ED-P8 for guile-devel@gnu.org; Wed, 10 Nov 2010 17:01:59 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:52939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGIju-0003DY-FT for guile-devel@gnu.org; Wed, 10 Nov 2010 17:01:58 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PGIjq-0000IK-8N for guile-devel@gnu.org; Wed, 10 Nov 2010 23:01:54 +0100 Original-Received: from yoda.fdn.fr ([80.67.169.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Nov 2010 23:01:54 +0100 Original-Received: from ludo by yoda.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Nov 2010 23:01:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: yoda.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Brumaire an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:VGofn/jkrzppPrq73evDxe3M9qA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11126 Archived-At: Hello! Looks good to me, now that I know about inexact integers. ;-) Just a couple of details: Mark H Weaver writes: > From 19a24107af814e34fe63d02478bfb9441354625e Mon Sep 17 00:00:00 2001 > From: Mark H Weaver > Date: Thu, 4 Nov 2010 22:10:02 -0400 > Subject: [PATCH] Fix bugs in expt and integer-expt > > * libguile/numbers.c (expt): Fix bug that caused expt to throw an > exception whenever the base was exact and the exponent was an > inexact integer, e.g. (expt 5 6.0). > > (expt): Fix bug that caused expt to introduce spurious imaginary > parts in the result when the base was an inexact negative real and > the exponent was an integer, e.g. (expt -1.0 2) > > (integer-expt, expt): Change behavior of (integer-expt 0 -1), and > therefore also (expt 0 -1), to return NaN, per R6RS (actually, R6RS > says we should throw an exception or return an "unspecified number > object", but for now we use NaN). Formerly we returned 0, per R5RS. > R5RS claims that 0^x=0 for all non-zero x, but that's mathematically > incorrect, and probably an oversight. > > (integer-expt): Consistently throw a wrong-argument-type exception > when the exponent is inexact. Formerly, it didn't always check this > if the base was 0, 1, or -1. > > * test-suite/tests/numbers.test ("integer-expt", "expt"): Add tests. Please use the C function names for C code, in the log. Also, can you add a reference to bug #31464 in the log and next to the corresponding test cases? Finally, can you document the change for 0^x with x != 0 in NEWS and explain the departure from R5RS in doc/ref/api-data.texi? Thanks! Ludo’.