help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is 0.01 here not 0.01 here 0.009999999999999?


From: Jean Louis
Subject: Re: What is 0.01 here not 0.01 here 0.009999999999999?
Date: Sat, 3 Apr 2021 00:19:10 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* John Yates <john@yates-sheets.org> [2021-04-02 23:48]:
> On Fri, Apr 2, 2021 at 1:07 PM Jean Louis <bugs@gnu.support> 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
> <http://pages.cs.wisc.edu/~david/courses/cs552/S12/handouts/goldberg-floating-point.pdf>
> floating-poing arithmetic
> <http://pages.cs.wisc.edu/~david/courses/cs552/S12/handouts/goldberg-floating-point.pdf>

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]