Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Floating-point arithmetic
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Binary-to-decimal conversion with minimal number of digits === Converting a double-precision binary floating-point number to a decimal string is a common operation, but an algorithm producing results that are both accurate and minimal did not appear in print until 1990, with Steele and White's Dragon4. Some of the improvements since then include: * David M. Gay's ''dtoa.c'', a practical open-source implementation of many ideas in Dragon4.<ref name="Gay_1990"/> * Grisu3, with a 4× speedup as it removes the use of [[bignum]]s. Must be used with a fallback, as it fails for ~0.5% of cases.<ref name="Loitsch_2010"/> * Errol3, an always-succeeding algorithm similar to, but slower than, Grisu3. Apparently not as good as an early-terminating Grisu with fallback.<ref name="mazong"/> * Ryū, an always-succeeding algorithm that is faster and simpler than Grisu3.<ref name="Adams_2018"/> * Schubfach, an always-succeeding algorithm that is based on a similar idea to Ryū, developed almost simultaneously and independently.<ref name="Giulietti"/> Performs better than Ryū and Grisu3 in certain benchmarks.<ref name="abolz"/> Many modern language runtimes use Grisu3 with a Dragon4 fallback.<ref name="double_conversion_2020"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)