From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: Inconsistency: sometimes an integer, sometimes a float Date: Thu, 23 Jan 2014 17:07:32 +0100 Message-ID: <87eh3ylm0r.fsf@yahoo.fr> References: <4ce73e74-a069-4e8d-b606-5aa76b848940@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390493273 9054 80.91.229.3 (23 Jan 2014 16:07:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jan 2014 16:07:53 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: djc Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 23 17:08:00 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W6Moy-0006gh-1q for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jan 2014 17:08:00 +0100 Original-Received: from localhost ([::1]:41987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6Mox-00051o-I9 for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jan 2014 11:07:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6Moa-00051T-Hc for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 11:07:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6MoT-0004H4-3P for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 11:07:36 -0500 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:21503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6MoS-0004Gn-UL for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 11:07:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApcGAD094VKkD4Nx/2dsb2JhbABbhRu6coEmdIImAQEEeRAIAyElDwEEDTwTh3ABAxGqMZUUAUoNhVYXh3SEeIIUB4Q4BJY3gWyGMIYthTuDLjs Original-Received: from geodiff-mac3.ulb.ac.be (HELO geodiff-mac3) ([164.15.131.113]) by smtp.ulb.ac.be with ESMTP; 23 Jan 2014 17:07:25 +0100 In-Reply-To: <4ce73e74-a069-4e8d-b606-5aa76b848940@googlegroups.com> (djc's message of "Thu, 23 Jan 2014 02:39:07 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95577 Archived-At: Err, sorry for previous message, it was sent by accident. djc writes: > "(/ 536870911 1000000)" is an integer. > "(/ 536870912 1000000)" is a float. What I was saying is : I can reproduce this from -Q : /tmp $ emacs -Q --batch --eval '(message "%s" (type-of (/ 536870912 1000000)))' float /tmp $ emacs --version GNU Emacs 24.3.50.2 (...) It's because: $ emacs -Q --batch --eval '(message "%s" (type-of 536870912))' float which itself comes from: $ emacs -Q --batch --eval '(message "%s" (> 536870912 most-positive-fixnum))' t explanation at: (info "(elisp) Integer Type") ,---- | As a special exception, if a sequence of digits specifies an integer | too large or too small to be a valid integer object, the Lisp reader | reads it as a floating-point number (*note Floating Point Type::). For | instance, if Emacs integers are 30 bits, `536870912' is read as the | floating-point number `536870912.0'. `---- HTH, -- Nico.