Accuracy of Mathematical Functions

Paul Zimmermann Paul.Zimmermann@inria.fr
Fri Mar 6 08:02:50 GMT 2026


       Hi,

> One thing I would personally love to see added is strto{f,d,ld}() --
> converting decimal strings to binary floating-point is notoriously complex to
> do with proper rounding, but there are algorithms out there now that will do
> so correctly without requiring ridiculous amount of computation, and there
> really is no good reason not to take advantage of that.

the strto* functions are very different from those we test:

* they take decimal strings as input instead of floating-point numbers

* their input is not in a finite set: our search algorithm requires a finite
  set as input

Last time I checked the GNU libc with hard-to-round cases I did not find any
incorrectly rounded result (but I don't remember if it was strtod or dtostr).

Paul



More information about the Libc-alpha mailing list