Re: gcc 11.1.0: printf("%.43f\n", 0x1.52f8a8e32e982p-140): printed value is incorrectly rounded

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Nov  4 19:54, Keith Packard wrote:
> Brian Inglis <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.