From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: What is 0.01 here not 0.01 here 0.009999999999999? Date: Fri, 02 Apr 2021 20:41:53 +0300 Message-ID: <87eefsk2hq.fsf@iki.fi> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17676"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/27.1.91 (x86_64-pc-linux-gnu) Cc: help-gnu-emacs@gnu.org To: Jean Louis , Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 02 19:47:17 2021 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 1lSNt3-0004Nc-RJ for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Apr 2021 19:47:13 +0200 Original-Received: from localhost ([::1]:36374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSNt2-0004aL-JF for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Apr 2021 13:47:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSNoH-00046S-40 for help-gnu-emacs@gnu.org; Fri, 02 Apr 2021 13:42:17 -0400 Original-Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]:36172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSNoD-0003Tn-FQ for help-gnu-emacs@gnu.org; Fri, 02 Apr 2021 13:42:16 -0400 Original-Received: from mithlond (mobile-access-5d6a56-157.dhcp.inet.fi [93.106.86.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by meesny.iki.fi (Postfix) with ESMTPSA id 3ACE220232; Fri, 2 Apr 2021 20:42:00 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1617385320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SusJtZmTmcTTHYCVSWi5Y8SckPjKqJtOMCerQG+/kWE=; b=IUPSCpC7+0ocG0YIi8NDMeaq1zQ2UTuspgop1mhpvGrBZFguYpT396IV3np6ZPHTp/vAY2 0nCliqUvhT7p+YtHGYucJHG71U4mvQnYi9ZUU/f64i3bqG6gCxEnxuhs/glDnoK6Eed7qU agAd+ZrilSDqtmXBoMoliZeSJ2OY5SQ= In-Reply-To: ARC-Seal: i=1; s=meesny; d=iki.fi; t=1617385320; a=rsa-sha256; cv=none; b=yffncpNHaAPcgFlpe48MRFUYCkep41+RKIfsgFcyTLiv70FkS2pKAgrdmlmFFNb7tRVhn0 5CWIQ/gQa5BFWEk62GtDh7dhY1/AnV7Q+xfanW3qhgYnKTzXoD6hCw8pJ2kTk8cylRG+9T zPfGckIK+2sTd1A9OguzUoBYjBPy/LA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1617385320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SusJtZmTmcTTHYCVSWi5Y8SckPjKqJtOMCerQG+/kWE=; b=b89E+e/n8k7WbV/Eguuc75JA2z2BljWjeFaNsEDPGz8NtN5uPmS9dLyr8r/Ik8F2xhpVSY o9Pb2TLdK//jKHGdo7uZUeqJ/vnkl69NOQgwT4GggprW6T8ts7V6Ge+R3qGVhDUReYdAwD m97XranrcoKLy13I60GgCoepSmssNO0= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi Received-SPF: pass client-ip=2001:67c:2b0:1c1::201; envelope-from=tlikonen@iki.fi; helo=meesny.iki.fi X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:128816 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * 2021-04-02 20:03:54+0300, Jean Louis wrote: > Not that I need the absolute internally, just the practical > result as we learned it in school like that 10.11 plus 0.01 > results with 10.12 and not something else. Results are used for > automated version numbers (in some cases). As you have learned, floating point numbers are not decimal numbers even if they are read and printed as such. For decimal mathematics you can use calc-eval function. Some comparison: ELISP> (+ 10.12 0.01) 10.129999999999999 ELISP> (calc-eval "10.12 + 0.01") "10.13" ELISP> (* 3 0.1) 0.30000000000000004 ELISP> (calc-eval "3 * 0.1") "0.3" =2D-=20 /// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/ // OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTJW2wqtelxC1gHdbitnXWr7pTCcwUCYGdXYRAcdGxpa29uZW5A aWtpLmZpAAoJEK2ddavulMJzBTUA+wSM2VlkBP5axDP9TxKenMXaDvHQDR5IjJLI u7OsEEt2AQCtYvFD0/2pY+rE/BGHje3VMXGdMExaBcF+Il46D5USDA== =YHZ8 -----END PGP SIGNATURE----- --=-=-=--