Printing Floating-Point Numbers (2014)
Great links, thanks. I sometimes noodle with a faster printf for Java, mostly for giggles. I also found these:
Dragon4 and Grisu3: Algoritms to Display Floating Point Numbers
https://www.clarusft.com/dragon4-and-grisu3-algorithms-to-di...
"Printing Floating-Point Numbers Quickly and Accurately with Integers" by Florian Loitsch
http://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/pr...
And its implementation in C
https://github.com/google/double-conversion
Here's a Java implementation of Grisu2 algorithm.
See also Russ Cox's take on this: http://research.swtch.com/ftoa
> Personally, I don't use anything with an MIT or BSD style license because I'd rather avoid the legal baggage.
Gees, what a troll.
It reminds me that it's annoying that there is no "engineering" mode for printf (to force the exponent to be a multiple of three). There is this project on github using %.*f: https://github.com/dhoerl/EngineeringNotationFormatter