On Tue, 20 Jun 2000, Keith Refson wrote:
> I'll copy this to the list as it's of general interest. Herein begins
> floating-point arithmetic 101. :)
[snip - description of FP calculations]
> Of course there are ways around this. If you add up the numbers in a
> different order you will get a different result, since floating point
> arithmetic is not associative.
Or we can do it the way the accountants do.
1) Use quantities that we can (and do) express EXACTLY.
2) Whenever we make an inexact calculation, IMMEDIATELY round it to an exact
value.
> This is why there is an entire field of mathematics - numerical
> analysis - devoted to devising ways of performing numerical
> calculations accurately
...
> It is far from easy and far from obvious.
> Here endeth the lesson.
Well, Herr Doktor, the problem is that numerical analysis is no longer
required study for wanna'be engineer/programmers. Neither is a historical
perspective. Further, the youngsters of today in Western cultures are
unwilling to accept the "respect your elders" ethic which remains in the
Eastern cultures. As a direct result, they are bound to repeat the mistakes
of the past.
Been there; done that, too.
... But then I grew up.
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]