Boost licensed implementation of Fabian Loitsch's Grisu-algorithm

kdevel kdevel at vogtner.de
Fri Jan 4 19:38:36 UTC 2019


On Friday, 4 January 2019 at 17:41:19 UTC, Andre Pany wrote:
> This implementation of Fabian Loitsch's Grisu-algorithm

"[...] we propose a variant, Grisu3, that detects (and
aborts) when its output may not be the shortest. As a consequence
Grisu3 is incomplete and will fail for some percentage of its 
input.
Given 11 extra bits roughly 99.5% are processed correctly and
are thus guaranteed to be optimal (with respect to shortness and
rounding). The remaining 0.5% are rejected and need to be printed
by another printing algorithm (like Dragon4)." [1]

[...]

> Can we add it to druntime/phobos for
> Compile time float to string conversion?

What kind of source code could benefit from speeding up this 
conversion?

[1] Florian Loitsch: Printing Floating-Point Numbers Quickly and 
Accurately
     with Integers. In Proceedings of the 2010 ACM SIGPLAN
     Conference on Programming Language Design and Implementation, 
PLDI 2010



More information about the Digitalmars-d mailing list