From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan@gnu.org (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: integer overflow Date: Sun, 07 Mar 2010 20:05:11 +0100 Message-ID: <87sk8cj6l4.fsf@gnu.org> References: <4B8147A9.7030504@gmail.com> <87ljemdzxo.fsf@stupidchicken.com> <4B83682D.5010804@gnu.org> <87vddmpw4s.fsf@stupidchicken.com> <87hbp2fwoi.fsf@gnu.org> <87wrxrr4md.fsf@gnu.org> <3vsk8ecg6a.fsf@fencepost.gnu.org> <873a0euot4.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267996503 25743 80.91.229.12 (7 Mar 2010 21:15:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 7 Mar 2010 21:15:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 07 22:14:58 2010 Return-path: Envelope-to: ged-emacs-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 1NoNoQ-0003M7-59 for ged-emacs-devel@m.gmane.org; Sun, 07 Mar 2010 22:14:58 +0100 Original-Received: from localhost ([127.0.0.1]:58047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoNoO-0001wO-UV for ged-emacs-devel@m.gmane.org; Sun, 07 Mar 2010 16:14:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NoLmx-0003zu-Fx for emacs-devel@gnu.org; Sun, 07 Mar 2010 14:05:19 -0500 Original-Received: from [140.186.70.92] (port=54569 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoLmv-0003zb-Tg for emacs-devel@gnu.org; Sun, 07 Mar 2010 14:05:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NoLmu-0002OQ-My for emacs-devel@gnu.org; Sun, 07 Mar 2010 14:05:17 -0500 Original-Received: from smtprelay-h11.telenor.se ([62.127.194.4]:54868) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NoLmu-0002OD-0E for emacs-devel@gnu.org; Sun, 07 Mar 2010 14:05:16 -0500 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-h11.telenor.se (Postfix) with ESMTP id 71187EA393 for ; Sun, 7 Mar 2010 20:05:17 +0100 (CET) X-SMTPAUTH-B2: X-SENDER-IP: 85.228.203.95 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjQ6AOaHk0tV5MtfPGdsb2JhbACHYJNlDAEBAQE3LbcyhHgE X-IronPort-AV: E=Sophos;i="4.49,598,1262559600"; d="scan'208";a="47077062" Original-Received: from c-5fcbe455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.203.95]) by ipb2.telenor.se with ESMTP; 07 Mar 2010 20:05:14 +0100 Original-Received: by muon.localdomain (Postfix, from userid 1000) id 4884C484108; Sun, 7 Mar 2010 20:05:13 +0100 (CET) Mail-Copies-To: never In-Reply-To: <873a0euot4.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 05 Mar 2010 22:11:35 -0500") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Sun, 07 Mar 2010 16:14:51 -0500 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:121715 Archived-At: Chong Yidong writes: > Glenn Morris writes: > >> I don't really understand it. In a 32-bit Emacs: >> >> (1+ 536870911) -536870912 >> (+ 2 536870911) -536870911 >> (1+ 536870912) 536870913.0 >> (1+ 4294967295) overflow >> (1+ 4294967295.0) 4294967296.0 >> >> Can you summarize how it's supposed to work? > > The change affects the Lisp reader: reading "536870912" or any larger > number now gives you a float Lisp object or an error if the integer is larger than 32 bits, as the fourth example shows.