From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ramakrishnan Muthukrishnan Newsgroups: gmane.lisp.guile.devel Subject: Re: fix for expt bug Date: Tue, 2 Nov 2010 10:52:56 +0530 Message-ID: References: <8762whnc4d.fsf@yeeloong.netris.org> <87r5f4l3yt.fsf@yeeloong.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1288675449 7339 80.91.229.12 (2 Nov 2010 05:24:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Nov 2010 05:24:09 +0000 (UTC) Cc: guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Nov 02 06:24:05 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 1PD9Li-0004yM-KC for guile-devel@m.gmane.org; Tue, 02 Nov 2010 06:23:58 +0100 Original-Received: from localhost ([127.0.0.1]:41939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PD9Lh-0006e2-Sl for guile-devel@m.gmane.org; Tue, 02 Nov 2010 01:23:57 -0400 Original-Received: from [140.186.70.92] (port=35826 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PD9La-0006bu-CI for guile-devel@gnu.org; Tue, 02 Nov 2010 01:23:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PD9L3-0001wT-SE for guile-devel@gnu.org; Tue, 02 Nov 2010 01:23:50 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:57752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PD9L3-0001wN-O2 for guile-devel@gnu.org; Tue, 02 Nov 2010 01:23:17 -0400 Original-Received: by vws18 with SMTP id 18so4864599vws.0 for ; Mon, 01 Nov 2010 22:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=E7CZG/BVNvSAsAdqd6HiMyxT/4UPdgtFcW7TAItT7dA=; b=txr4p6bqq6rTpCQ8QyMGCXa4SlL8RSStkKalBhWO39WinG0k53ZOYRbLbxi6QxeZT1 skQZUmBe8iXeiPUnjxQxzbs1hWGveo/9rlrV0jV55aWe8aRTt1/lZUJufTAFKumfurMf OAk4GxoFSAp3qwQrIkNx+wkdpxirLgaN2TdTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=cQzwljRSiAhsItnzCqwoF086tIIJ7WHZa78OndE/zvWGBfDqgQG3RVWoITOJSmqBAF SFB3/21fHNhwC1VlIPsZ1JDZfChttAcTYYc4hXEx26KiUBgujXw2zK2NmlT1haf9G3ME wy6ypqJuOlNbzwRXPLCaIoK2dKgo4xVb0gS4M= Original-Received: by 10.229.185.145 with SMTP id co17mr15759800qcb.108.1288675396987; Mon, 01 Nov 2010 22:23:16 -0700 (PDT) Original-Received: by 10.229.40.147 with HTTP; Mon, 1 Nov 2010 22:22:56 -0700 (PDT) In-Reply-To: <87r5f4l3yt.fsf@yeeloong.netris.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:11099 Archived-At: On Tue, Nov 2, 2010 at 10:25 AM, Mark H Weaver wrote: > Hi Ramakrishnan, > > Thanks for the revised patch. =C2=A0There are still some problems: > [...] > > This is an improvement, but isn't quite right. =C2=A0scm_integer_expt > requires that y be an exact integer, but x is allowed to be any scheme > number whatsoever. =C2=A0So the "scm_exact_p (x)" doesn't belong. =C2=A0I= t should > simply be changed to "scm_exact_p (y)" instead. > > The other problem is that !SCM_FRACTIONP is not the right test. > Although it is currently true that the only exact numbers in guile are > integers and rationals, there's no guarantee that other exact numbers > won't be added in the future. > > The test above should be this: > > =C2=A0 =C2=A0if (scm_is_true (scm_exact_p (y)) && scm_is_integer (y)) Thanks Mark, for the comments. I am learning a lot. I will make the changes and test them. --=20 =C2=A0 Ramakrishnan