From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Norbert =?ISO-8859-1?Q?Gr=FCn?= Newsgroups: gmane.emacs.bugs Subject: Are integer operations really integral? Date: Mon, 09 Jan 2006 20:57:37 +0100 Message-ID: <1136836657.43c2c0311e572@www.x-mail.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1136844266 29913 80.91.229.2 (9 Jan 2006 22:04:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Jan 2006 22:04:26 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 09 23:04:22 2006 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ew57W-00019H-Sd for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jan 2006 23:04:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ew59T-0000J5-Ha for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jan 2006 17:06:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ew42Z-0004Cw-BF for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2006 15:54:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ew42U-00049r-Bz for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2006 15:54:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ew42U-00049i-7f for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2006 15:54:50 -0500 Original-Received: from [65.110.6.10] (helo=mailer.xmail.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ew44o-0003nm-Ug for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2006 15:57:15 -0500 Original-Received: from [80.135.71.89] by www.xmail.net with HTTP for ; Mon, 09 Jan 2006 20:57:37 +0100 Original-To: bug-gnu-emacs@gnu.org X-Mailer: Web XMail 3.2a X-Mail.net: *** Free Web Based E-Mail & Hosting *** X-Mailman-Approved-At: Mon, 09 Jan 2006 17:06:06 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:14701 Archived-At: Dear Madam or Sir! I recently used Emacs 20.7 for WinNT to check the date of the initial issue of our longtime weekly pulp Sci-Fi novel Perry Rhodan (www.Perry-Rhodan.net). I fired up the calendar, positioned to 2006-01-06 for volume 2316 and said C-u 2316 C-p to go back this many weeks. I landed on 1961-08-18 whereas the mag part told of 1961-09-08 which is three weeks later. I sent already a mail to the publishers whether they had issued two volumes a week for a couple of times when changing publishing day which had happened a few times in the past. The error is 0.13% which may or may not pile up in floating point calculations when iterated that many times. But a C-u repetition is integral in its very nature and the ELISP engine should be much happier with integers for decrementing the loop over the than fiddling with floats and doubles. ALGOL60 allowed REALs as loop and ARRAY indices, PASCAL stopped this abuse. C(++) may allow it, but it is highly disrecommended because a loop termination condition testing for equality against an integral value like zero is almost guaranteed to fail resulting in an endless loop. Also testing for inequality will result in haphazard one-off errors hard to debug. Also integers should be large enough to avoid a rollover as I realised once on a VAX. So please check whether your integer arithmetic is not secretly converted to float in a dark corner of your code albeit this should be ironed out long ago regarding the major version (20.7). Kind Regards Norbert Grün (gnor-spam@x-mail.net) -- Stop wasting everybody else's ressources! ------------------------------------------------------------------------------------ Free X-Mail.net, Voice Calls (VoIP) and Messages, Messenger, http://www.x-mail.net SnoopBlocker Anonymous SSL Secure Web Surfing, http://www.snoopblocker.com Search Teradex Web Site Directory http://www.teradex.com