Re: [xml] Getting crazy with float parsing
- From: Bjorn Reese <breese mail1 stofanet dk>
- To: xml gnome org
- Subject: Re: [xml] Getting crazy with float parsing
- Date: Thu, 09 May 2002 12:37:25 +0000
Peter Jacobi wrote:
Whereas the standard runtimes (libc and msc) give
the uninitiated human observers some surprise, they
observe IEEE 754 and output a result differing only
in the least significant digit from the true result.
This can clearly be seen in 2.0/3.0 example, where the
trio error is about 9 times higher than the others.
You omitted to calculate the error of the two other cases.
The higher error for some numbers is a due of the need for more binary
digits to round numbers more appropriately for non-binary radixes
(specifically decimal numbers).
Before making any decision on this issue, we should clarify the purpose
of XPath and XSL floating-point numbers. Is it to provide high-accuracy
calculations, or to present decimal-point number to users?
In the former case we should probably consider switching to 'long
double'. In the latter case common knowledge tells us that 0.667 is
a more correct representation of 2/3 than 0.6663, even if it is less
accurate.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]