Re: [xml] Getting crazy with float parsing



Hello,

The latest baseline of trio (v 1.7) now handles these numbers
appropriately.
Consider the following statement

  printf("%30.24f\n%30.24f\n%30.24f\n", 39413.80, 1.4, (2.0/3.0));

The libc printf on my machine outputs

  39413.800000000002910383045673
      1.399999999999999911182158
      0.666666666666666629659233

whereas trio outputs

  39413.800000000000000000000000
      1.400000000000000000000000
      0.666666666666667000000000

Let me know if you want to use this, and I'll upgrade libxml to the latest
trio baseline.


The printf in MS C-runtime 7 (XP) gives

    39413.800000000003000000000000
        1.399999999999999900000000
        0.666666666666666630000000

which is not much different to what your libc does. I believe trio should be
used here.

Ciao
Igor





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