Is there a standard C method for printing floating point values ​​"excellent" a la Dragon4?

Reading There will be dragons: successes in problems that you did not even know about what you have. I noticed that they are comparing the new algorithm with that used in glibc printf:

Grisu3 is about 5 times faster than the algorithm used by printf in GNU libc

But at the same time, I could not find any format specifier for printfwhich would automatically find the best number of decimal places to print. All I tried either have some weird defaults, like 6 digits after the decimal point for %for 2 after the point for %gor 6 after the point for %e.

How can I use this implementation of the algorithm in glibc mentioned in the article? Is there any such implementation in glibc, and even it is generally discussed by the standard?

+4
source share
2 answers

This is an actual article. A blog post refers to the results in section 7 (in other words, “they” don't compare anything on a blog, “they” strip information from an actual article, omitting important details):

table of results with information

Dragon4 Grisu3 , " " ( "" ). Java , Ruby. C , " " , libc Dragon4 Grisu3.

+3

, " ", . , "". - , C11 %a ( , ).

C11 - 6 %f %e, %g:

P , , 6, , 1, . , E X: - P > X ≥ -4, f ( F) P - (X + 1). - e ( E) P - 1.

, . , glibc 5 . , , .

0

All Articles