From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#8611: fixnum arithmetic should not wrap around Date: Tue, 03 May 2011 21:10:00 -0700 Organization: UCLA Computer Science Department Message-ID: <4DC0D198.7020506@cs.ucla.edu> References: <4DC0491D.7090404@cs.ucla.edu> <4DC0A99E.3090706@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1304483828 8556 80.91.229.12 (4 May 2011 04:37:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 May 2011 04:37:08 +0000 (UTC) Cc: 8611@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 04 06:37:00 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QHTpb-0007rh-7m for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 May 2011 06:36:59 +0200 Original-Received: from localhost ([::1]:42650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHTpa-00048h-DO for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 May 2011 00:36:58 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHTpX-00048R-ND for bug-gnu-emacs@gnu.org; Wed, 04 May 2011 00:36:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHTpW-00089p-T3 for bug-gnu-emacs@gnu.org; Wed, 04 May 2011 00:36:55 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHTpW-00089k-RR for bug-gnu-emacs@gnu.org; Wed, 04 May 2011 00:36:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QHTQU-0006Mm-8e; Wed, 04 May 2011 00:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 May 2011 04:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8611-submit@debbugs.gnu.org id=B8611.130448221224411 (code B ref 8611); Wed, 04 May 2011 04:11:02 +0000 Original-Received: (at 8611) by debbugs.gnu.org; 4 May 2011 04:10:12 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QHTPg-0006Lg-1j for submit@debbugs.gnu.org; Wed, 04 May 2011 00:10:12 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QHTPd-0006LU-D1 for 8611@debbugs.gnu.org; Wed, 04 May 2011 00:10:10 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id CBB0139E8106; Tue, 3 May 2011 21:10:02 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id inmOFCHDGUQ2; Tue, 3 May 2011 21:10:01 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id AF2F539E80F5; Tue, 3 May 2011 21:10:01 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 04 May 2011 00:11:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46184 Archived-At: On 05/03/11 18:29, Stefan Monnier wrote: >> Would it be better to change Emacs to use bignums if available? > ... Other than Calc (and only if someone goes thorugh the trouble to > port it to the new bignum primitives), I can't think of too many > packages that would benefit, I can. The calendrical and time zone stuff would benefit. That's the only elisp code that I've had much to do with, but a quick scan of the Elisp source code suggests several other modules would benefit as well: arc-mode.el, byte-opt.el, Gnus, imenu.el, imap.el, lazy-lock.el, and there's more but I got tired of looking. > I guess "from outside of Elisp" is a better description than "from some > C function". The Lisp reader brings values from outside Elisp > into Elisp. I'm still not understanding the principle. For example, (string-to-number "536870912") operates entirely within Elisp, but it returns a float when the integer is out of range. Perhaps the principle is supposed to be "arithmetic operations involving only integers always return integers"? But that's not right either, since (expt 2 -1) returns 0.5. In contrast, the principle "operations that would return an integer out of range, return a nearby float instead" is simple and easy to explain.