From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: real numbers and integer-expt. Date: 13 Mar 2002 20:23:56 +0100 Sender: guile-devel-admin@gnu.org Message-ID: <873cz4nuer.fsf@zagadka.ping.de> References: <876640j23t.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016047477 3300 127.0.0.1 (13 Mar 2002 19:24:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2002 19:24:37 +0000 (UTC) Cc: guile-devel@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16lEMX-0000r8-00 for ; Wed, 13 Mar 2002 20:24:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16lEM0-00066t-00; Wed, 13 Mar 2002 14:24:04 -0500 Original-Received: from dialin.speedway42.dip134.dokom.de ([195.138.42.134] helo=zagadka.ping.de) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16lEJv-000626-00 for ; Wed, 13 Mar 2002 14:21:55 -0500 Original-Received: (qmail 1272 invoked by uid 1000); 13 Mar 2002 19:23:56 -0000 Original-To: Rob Browning In-Reply-To: <876640j23t.fsf@raven.i.defaultvalue.org> Original-Lines: 19 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:19 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:19 Rob Browning writes: > integer-expt says: > > SCM_DEFINE (scm_integer_expt, "integer-expt", 2, 0, 0, > (SCM n, SCM k), > "Return @var{n} raised to the non-negative integer exponent\n" > "@var{k}.\n" > "\n" > > but in the code we check to see if k satisfies SCM_REALP and if it > does, we coerce it to an int and see if we get any lossage. If we > don't then we decide it's OK to use it. Is that what we want, Yes. Floats can be integers, too. However, there's a bug nevertheless: floats can represent integers that don't fit into 32 bit ints. Also, complex numbers can be ints as well. Also also, the docstring talks about non-negative powers, but the code handles negative ones as well. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel