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.
|
|---|