GCD_Dilemma wrote...
...
I guess the key is "binary fractions" & "IEEE approximations." Sinc 4/10 is NOT
an infinitely repeating DECIMAL number, I assume you mean that t store it in
1's & 0's with a sign & all, it DOES end up being a repeating BINAR number
when converted & stored in a computer's registers & therein lies th IEEE
approximation when converting back & forth.
Correct.
Evidently, there are some conversion "losses" & differences whe storing &
working with numbers & evaluations that to the user's eye & logi should equate
to being the same but in the practical PC world do not work out tha
way.
Correct. The key is to realize that spreadsheets are actually a form o
programming language, so you must adopt a programmer's eye & logi
rather than those of a user. Until you do so, this sort of thing wil
drive you nuts. Of course, this assumes you don't want to be drive
nuts.
Therefore, things like (1.4 - 1) does not necessarily equal (0.4) I ALL CASES
when being stored & manipulated on the computer (but in some case they will,
shown below).
So, in Excel (to 30 decimal places):
=((0.4)*10-4)
yields: 0.000000000000000000000000000000
but
=((1.4-1)*10-4)
yields: -0.000000000000000888178419700125
Yup. Exactly as it does in any other programming language using IEE
double precision floating point that doesn't perform constant ter
elimination at compile time.
The point here is that the 1.4 term starts with a bit for 2^0 (the 1 t
the left of the decimal point), while the 0.4 term begins with the 2^-
bit. Thus the two are truncated at different bits, as Jerry mentioned.
THIS IS HOW IEEE STANDARD 754 WORKS.
Interesting & vexxing at the same time.
Vexxing in that:
=((1.4-1)*10-B10)
If B10 ranges from 0 to 9, the only time this loss apparently shows u is for
numbers 3 & 4 when the resulting outcome hovers right around 0 on it journey
from positive to negative numbers. All other numbers seem to yiel perfect
whole integers.
...
If you change 1.4 to 1.7, your B10 anomalies may differ.
To repeat, as long as you maintain a 'user' perspective, you'l
repeatedly bang your head against walls. You need to adopt a programme
perspective