Re: [xml] Getting crazy with float parsing



Hi Bjorn, All,

You omitted to calculate the error of the two other cases.

Not much to calculate in these cases, as the AI in trio
manages to get the true result! So trio is better in
these cases but the native implementation have only
an error in the least significant digit, which make
them compliant, too.

So trio is compliant in 2 of 3 cases, the native implementations
in 3 of 3 cases.

I agree that trio does a good job in getting the exact
results in some cases, but as you already stated, it
depends on the requirements, which way is better.


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.

Huh? In my opionion a more accurate result is also a more
correct result. 

And, this is a constructed case. When specifying only a 
few digits of precisions, all implementations will agree 
on 0.667 for three digits after the decimal point etc.

The difference comes in when the format asks for a rather 
large number of digits. IMHO this is a sure sign, the user
wants the most correct representation.

Regards,
Peter Jacobi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]