Sciweavers

POPL
2016
ACM

Printing floating-point numbers: a faster, always correct method

8 years 7 months ago
Printing floating-point numbers: a faster, always correct method
Floating-point numbers are an essential part of modern software, recently gaining particular prominence on the web as the exclusive numeric format of Javascript. To use floating-point numbers, we require a way to convert binary machine representations into human readable decimal outputs. Existing conversion algorithms make trade-offs between completeness and performance. The classic Dragon4 algorithm by Steele and White and its later refinements achieve completeness — i.e. produce correct and optimal outputs on all inputs — by using arbitrary precision integer (bignum) arithmetic which leads to a high performance cost. On the other hand, the recent Grisu3 algorithm by Loitsch shows how to recover performance by using native integer arithmetic but sacrifices optimality for 0.5% of all inputs. We present Errol, a new complete algorithm that is guaranteed to produce correct and optimal results for all inputs by sacrificing a speed penalty of 2.4× to the incomplete Grisu3 but 5.2...
Marc Andrysco, Ranjit Jhala, Sorin Lerner
Added 09 Apr 2016
Updated 09 Apr 2016
Type Journal
Year 2016
Where POPL
Authors Marc Andrysco, Ranjit Jhala, Sorin Lerner
Comments (0)