gcc 11.1.0: printf("%.43f\n", 0x1.52f8a8e32e982p-140): printed value is incorrectly rounded
Corinna Vinschen
vinschen@redhat.com
Mon Nov 8 09:57:11 GMT 2021
On Nov 4 19:54, Keith Packard wrote:
> Brian Inglis <Brian.Inglis@SystematicSw.ab.ca> writes:
>
> > Keith,
> >
> > I believe the implementation uses tables: that could be an issue in the
> > embedded world; can you comment on the table space required for 32, 64,
> > 128 bits?
>
> I don't have a long double implementation of the ryu code; 128 bit
> doubles would require 256 bit arithmetic (add/mul, fortunately no
> divide), and a bunch of analysis to generate the table values. The
> sample code on github only provides 32- and 64- bit
> implementations. Picolibc currently has an imprecise printf
> implementation for long double that works for Intel (80 bit) Risc-V
> (IEEE 128 bit) and Power PC ('double double' 128-bit).
We certainly need long double as well. Are the aforementioned
implementations sufficient? The current ldtoa is somewhat imprecise as
well for Intel, so maybe we're not worse off.
gdtoa might still be an option.
Corinna
More information about the Newlib
mailing list