From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: (- 2.8 1.6) ; 1.1999999999999997 Date: Tue, 11 Feb 2020 02:55:35 +0100 Message-ID: <87eev1yjjc.fsf@ebih.ebihd> References: <8736biywcn.fsf@ebih.ebihd> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="51664"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:8NUx/XPp++v/h/btgJ38DK8mPjs= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 11 02:56:04 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j1KmS-000DLP-Is for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 11 Feb 2020 02:56:04 +0100 Original-Received: from localhost ([::1]:42306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1KmR-0005ri-LB for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 20:56:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54770) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Km8-0005rX-5o for help-gnu-emacs@gnu.org; Mon, 10 Feb 2020 20:55:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1Km6-0003Nj-OU for help-gnu-emacs@gnu.org; Mon, 10 Feb 2020 20:55:44 -0500 Original-Received: from ciao.gmane.io ([159.69.161.202]:49306) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1Km6-0003IO-HY for help-gnu-emacs@gnu.org; Mon, 10 Feb 2020 20:55:42 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1j1Km5-000Cwc-Gz for help-gnu-emacs@gnu.org; Tue, 11 Feb 2020 02:55:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122398 Archived-At: Stefan Monnier wrote: >> (- 2.8 1.6) ; 1.1999999999999997 > > Emacs Lisp, like most common programming > language doesn't support rational numbers > (and even less real numbers, which can't be > faithfully represented in a computer) but > only floating point numbers. And like most > programming languages it uses the standard > IEEE representation supported natively by > most CPUs. This representation can't > represent 2.8 nor 1.6 (and nor 1.2) exactly. > > It so happens that "the representable number > closest to 2.8" minus "the representable > number closest to 1.6" is not equal to "the > representable number closest to 1.2". > >> With the TI-84 Plus, >> >> 2.8-1.6=1.2 > > IIUC those calculators used a decimal > floating point representation, which suffers > from the same kinds of problems of course, > but works better in this specific case. Sure seems like it :) -- underground experts united http://user.it.uu.se/~embe8573 https://dataswamp.org/~incal