in reply to Re^13: Decimal Floating Point (DFP) and does Perl needs DFP?
in thread Decimal Floating Point (DFP) and does Perl needs DFP?

Luckily, in practice you can usually do *some* rounding without jeopardising the accuracy of the final rounded-down result,

That is the reason for Intel FPUs use of 80-bit extended doubles. The theory being that if the FPU does all its internal calculations with 64 bits of precision, then by the time the results are returned as a double (with its 53 bits of precision) any inaccuracies accumulated through intermediate calculations will be thrown away.

Of course that's only true if the compiler(or programmer) correctly orders the calculations so that intermediate results can always be held in FP registers. Often the problem is that intemediate results get written out to ram (as doubles) to free up FP registers and thus the accumulated errors increase beyond their theoretic bounds.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
  • Comment on Re^14: Decimal Floating Point (DFP) and does Perl needs DFP?