From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?G=C3=B6ktu=C4=9F_Kayaalp?= Newsgroups: gmane.emacs.help Subject: Re: =?utf-8?B?4oCYdHJ1bmNhdGXigJk=?= on (float-time) causes arith range error on 32bit emacs Date: Wed, 03 Feb 2016 20:09:51 +0200 Message-ID: <877filoec0.fsf@xi.bootis> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1454522895 11090 80.91.229.3 (3 Feb 2016 18:08:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2016 18:08:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: eliz@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 03 19:08:05 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 1aR1qV-0005hf-7O for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 19:08:03 +0100 Original-Received: from localhost ([::1]:36819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR1qU-0005E1-Ej for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 13:08:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR1qA-0005Ds-DT for help-gnu-emacs@gnu.org; Wed, 03 Feb 2016 13:07:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR1q6-0005md-AT for help-gnu-emacs@gnu.org; Wed, 03 Feb 2016 13:07:42 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR1q0-0005k0-Ed; Wed, 03 Feb 2016 13:07:32 -0500 Original-Received: from mfilter26-d.gandi.net (mfilter26-d.gandi.net [217.70.178.154]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id F40621720A4; Wed, 3 Feb 2016 19:07:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter26-d.gandi.net Original-Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter26-d.gandi.net (mfilter26-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Ne1vdLgL_Ijn; Wed, 3 Feb 2016 19:07:09 +0100 (CET) X-Originating-IP: 78.180.140.84 Original-Received: from localhost (unknown [78.180.140.84]) (Authenticated sender: self@gkayaalp.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 48B2A1720A5; Wed, 3 Feb 2016 19:07:09 +0100 (CET) In-Reply-To: 83wpqsydm0.fsf@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.196 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:108988 Archived-At: On Fri, 29 Jan 2016 10:49:27 +0200, Eli Zaretskii writes: > No. The usual ways of handling this are either (a) leave the numbers > as floats, and just be more careful about comparisons; and (b) > represent large numbers as cons cells. >=20 > Since these are time values, I'd suggest (a) in your case. What math > requires integers, exactly, and why? Hi, I guess (a) will work, I just sent a patch to the user to test (I do not have a 32bit machine, though the math worked). This is what the function does: (defun forecast--sun-position-graphic () "Visualise the time since the rise of the sun and the time to the set t= hereof. =20=20 E.g.: =20=20 Quasi-midday: >=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=98=89=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94< Sunrise: =E2=98=89=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94< Sunset: >=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=98=89" (let* ((today (aref (forecast--assoca '(daily data) forecast--data) 0= )) (sunrise (forecast--assoca '(sunriseTime) today)) (sunset (forecast--assoca '(sunsetTime) today)) (now (truncate (float-time))) (daylen (- sunset sunrise)) (sunsec (- now sunrise)) (wwidth (window-body-width)) (graph (concat ">" (make-string (- wwidth 5) ?=E2=80=94) "<")) (sun ?=E2=98=89) (pos (cond ((< sunrise sunset now) (- wwidth 4)) ((> sunrise now) 0) (t (1- (/ sunsec (/ daylen wwidth))))))) (aset graph pos sun) graph)) The values =E2=80=98sunrise=E2=80=99 and =E2=80=98sunset=E2=80=99 come fro= m an API and they are integer timestamps. Sorry for the late reply, I somehow did not receive the replies to my message, I've some problems with e-mail. Please CC me directly if you reply, I'm not subscribed to the list. Thanks a lot, -gk. --=20 =C4=B0. G=C3=B6ktu=C4=9F Kayaalp. http://gkayaalp.com/