Re: [xml] Getting crazy with float parsing

Bjorn Reese wrote:

Although trio attempts to handle this situation (for example, it does
print 7/5 correctly, which my libc printf does not), it does not handle
all cases appropriately yet, and it also gets 39413.8 wrong. In fact,
this is an issue I have been looking at recently, but still haven't
found a solution for. If I do manage, I'll let you know.

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


whereas trio outputs


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

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