From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.help Subject: Re: =?utf-8?B?4oCYdHJ1bmNhdGXigJk=?= on (float-time) causes arith range error on 32bit emacs Date: Fri, 29 Jan 2016 09:55:00 +0000 Message-ID: <86bn84iubv.fsf@gmail.com> References: <87twlxqe8v.fsf@xi.bootis> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1454061354 27152 80.91.229.3 (29 Jan 2016 09:55:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jan 2016 09:55:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 29 10:55:48 2016 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 1aP5mM-00085e-PB for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jan 2016 10:55:46 +0100 Original-Received: from localhost ([::1]:60811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP5mM-0001k6-7H for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jan 2016 04:55:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP5mC-0001k0-1z for help-gnu-emacs@gnu.org; Fri, 29 Jan 2016 04:55:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aP5m7-0003wB-2T for help-gnu-emacs@gnu.org; Fri, 29 Jan 2016 04:55:35 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:51995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP5m6-0003w7-RW for help-gnu-emacs@gnu.org; Fri, 29 Jan 2016 04:55:30 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aP5lz-0007ij-Ar for help-gnu-emacs@gnu.org; Fri, 29 Jan 2016 10:55:23 +0100 Original-Received: from 82-69-64-228.dsl.in-addr.zen.co.uk ([82.69.64.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jan 2016 10:55:23 +0100 Original-Received: from andrewjmoreton by 82-69-64-228.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jan 2016 10:55:23 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 82-69-64-228.dsl.in-addr.zen.co.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:qYniIZGllSlagXUHnmGpM4QAVzk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:108911 Archived-At: On Fri 29 Jan 2016, Göktuğ Kayaalp wrote: > Hi all, > > I've a little package [1]. A user reported to me this error: > > Contacting host: api.forecast.io:443 > Opening TLS connection to `api.forecast.io'... > Opening TLS connection with `gnutls-cli --insecure -p 443 api.forecast.io'...done > Opening TLS connection to `api.forecast.io'...done > error in process sentinel: let*: Arithmetic range error: "truncate", 1454005216.6590292 > error in process sentinel: Arithmetic range error: "truncate", 1454005216.6590292 > error in process filter: let*: Arithmetic range error: "truncate", 1454005218.8166773 > error in process filter: Arithmetic range error: "truncate", 1454005218.8166773 > error in process sentinel: let*: Arithmetic range error: "truncate", 1454005220.8661127 > error in process sentinel: Arithmetic range error: "truncate", 1454005220.8661127 > > He is on a 32bit pc. These errors come from a function in which I > truncate some timestamps for some math that requires integers. Is there > a way to convert it to integer w/o error on a 32 bit machine? > > Interestingly, these values don't seem to exceed the limits for 32 bit > integers, am I wrong? Is there sth. different going on that I did not > catch? I'm rather novice with elisp, so sorry if I'm missing > sth. obvious and blundering the list. The Emacs integer representation is not the same size as a native machine integer, and the values you are using here are out of range. See the elisp manual: (info "(elisp) Integer Basics"). For example: (version) ; => "GNU Emacs 25.0.50.6 (i686-pc-mingw32) of 2016-01-29" most-positive-fixnum ; => 536870911 most-negative-fixnum ; => -536870912 (1+ 1454005216) ; => 1454005217.0 Note how the last result is a float. HTH AndyM