From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: What is 0.01 here not 0.01 here 0.009999999999999? Date: Sat, 3 Apr 2021 00:19:10 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34177"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) Cc: Help Gnu Emacs mailing list , Stefan Monnier To: John Yates Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 02 23:23:18 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 1lSRGA-0008nR-8z for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Apr 2021 23:23:18 +0200 Original-Received: from localhost ([::1]:57866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSRG9-0005jO-9K for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Apr 2021 17:23:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSRFo-0005j3-9M for help-gnu-emacs@gnu.org; Fri, 02 Apr 2021 17:22:56 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:37085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSRFm-0006WX-B1 for help-gnu-emacs@gnu.org; Fri, 02 Apr 2021 17:22:55 -0400 Original-Received: from localhost ([::ffff:41.202.241.42]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E1BA.0000000060678B2A.00006FE7; Fri, 02 Apr 2021 14:22:50 -0700 Mail-Followup-To: John Yates , Stefan Monnier , Help Gnu Emacs mailing list Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URI_DOTEDU=0.275 autolearn=no 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:128823 Archived-At: * John Yates [2021-04-02 23:48]: > On Fri, Apr 2, 2021 at 1:07 PM Jean Louis wrote: > > Thank you. I did browse it, did not yet understand it. > > And so, having made no progress towards understanding > computer-based floating point arithmetic, you press on > arguing from a position of ignorance. Oh John, not so harsh on me. I did understand the principle and thank you for presenting it simpler. Before few years I got it already. Understanding principle does not mean that I understand full documents, they have many references and mathematical terms that I cannot understand. There is no ignorance, and why assume so, when I need the feature? Person who does not need feature is not interested. But don't ask me to get as interested as mathematics professor, as I am not. All what I need is to increase the versio number in format NN.NN. There was solution with `calc-eval' that I did not know about. > Put most simply, on a machine in which floating point > numbers encode the significand (sometimes erroneously > termed the 'mantissa') using a binary representation, > there is no way to encode, and hence express, a fraction > whose divisor is not a power of 2. So you can encode > precisely 1/2, 1/4, 1/128, etc. But you will never have a > precise encoding of 1/3, 1/5, 1/10, etc. Nicely explained, I do understand it, it is clear, I have been playing with pocket calculators. Yet understanding the principle may not lead to comprehension of the whole subject. That word mantissa is in Wordnet as: * Overview of noun mantissa The noun mantissa has 1 sense (no senses from tagged texts) 1. mantissa, fixed-point part -- (the positive fractional part of the representation of a logarithm; in the expression log 643 = 2.808 the mantissa is .808) I did not find the word "significand", but I think you mean that above definition. > Much effort has gone into optimizing "round tripping", > the conversion of decimal numbers into the nearest > floating point number and getting it back out again. > > But you are asking for more. You want arithmetic on > imprecise representations of your perfect decimal > numbers to deliver precisely the same result as your > mental model. That is never going to happen. Actually, I am asking for less... how you did not see it? Yes, I need arithmetic on imprecise representations... to deliver what I want, and it is doing what I want. `calc-eval' is doing it, and my function is delivering me string that is increased for 0.01 -- well that is what I wanted, and is happening... several times per hour those numbers are increasing, function is working ;-p > I am not going to try to explain normalization, rounding, > rounding modes, etc. Suffice it to say that this is the > realm of numerical analysis, a rich field that traces its > roots straight back to Alen Turing. Excellent, but if function goes that deep, it would take a while to give me 10.11 increase for 0.01. > In closing, let me recommend David Goldberg's classic > 'What every computer scientist should know about > > floating-poing arithmetic > Thank you. I will browse it, to get the concept, not read it to get comprehension. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns Sign an open letter in support of Richard M. Stallman https://rms-support-letter.github.io/