From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: expt weirdness in floatfns.c Date: 06 Aug 2005 10:12:33 -0400 Message-ID: References: <87ek98at3c.fsf@gnufans.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1123338487 12801 80.91.229.2 (6 Aug 2005 14:28:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Aug 2005 14:28:07 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 06 16:28:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E1PeN-0007oF-0F for ged-emacs-devel@m.gmane.org; Sat, 06 Aug 2005 16:27:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E1PhH-0003d7-7U for ged-emacs-devel@m.gmane.org; Sat, 06 Aug 2005 10:30:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E1PfU-0002ZB-JX for emacs-devel@gnu.org; Sat, 06 Aug 2005 10:28:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E1PfR-0002X0-I4 for emacs-devel@gnu.org; Sat, 06 Aug 2005 10:28:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E1PfP-0002N0-1E for emacs-devel@gnu.org; Sat, 06 Aug 2005 10:28:52 -0400 Original-Received: from [207.245.121.138] (helo=mail.agora-net.com) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_ARCFOUR_SHA:16) (Exim 4.34) id 1E1Pct-00007t-J8 for emacs-devel@gnu.org; Sat, 06 Aug 2005 10:26:15 -0400 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.34) id 1E1PPd-0001UN-GP; Sat, 06 Aug 2005 10:12:33 -0400 Original-To: "D Goel" In-Reply-To: <87ek98at3c.fsf@gnufans.net> Original-Lines: 31 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41600 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41600 "D Goel" writes: > i think that both should return the proper values instead of > truncated integers i agree. how does the following patch look? thi ___________________________________ *** floatfns.c 4 Jul 2005 16:06:31 -0000 1.84 --- floatfns.c 6 Aug 2005 14:07:36 -0000 *************** *** 460,466 **** CHECK_NUMBER_OR_FLOAT (arg1); CHECK_NUMBER_OR_FLOAT (arg2); if (INTEGERP (arg1) /* common lisp spec */ ! && INTEGERP (arg2)) /* don't promote, if both are ints */ { /* this can be improved by pre-calculating */ EMACS_INT acc, x, y; /* some binary powers of x then accumulating */ Lisp_Object val; --- 460,467 ---- CHECK_NUMBER_OR_FLOAT (arg1); CHECK_NUMBER_OR_FLOAT (arg2); if (INTEGERP (arg1) /* common lisp spec */ ! && INTEGERP (arg2) /* don't promote, if both are ints, */ ! && 0 <= XINT (arg2)) /* or if we are taking the ARG2'th root */ { /* this can be improved by pre-calculating */ EMACS_INT acc, x, y; /* some binary powers of x then accumulating */ Lisp_Object val;