https://github.com/abolz/Drachennest Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} abolz / Drachennest Public * Notifications * Fork 7 * Star 76 Different algorithms for converting binary to decimal floating-point numbers License BSL-1.0 license 76 stars 7 forks Star Notifications * Code * Issues 8 * Pull requests 1 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights abolz/Drachennest This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 3 branches 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/a] Use Git or checkout with SVN using the web URL. [gh repo clone abolz/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @abolz abolz Relax restrictions in the Schubfach formatting procedure ... e6714a3 May 15, 2021 Relax restrictions in the Schubfach formatting procedure e6714a3 Git stats * 403 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time bench Remove outdated benchmark results November 1, 2020 21:22 ext Update build scripts January 21, 2020 20:52 resources Update benchmarks November 1, 2020 21:19 scripts Python3 June 21, 2020 14:20 src Relax restrictions in the Schubfach formatting procedure May 15, 2021 12:11 test Rounding may change the length of the significand March 28, 2021 19:56 .appveyor.yml Build a single test executable February 27, 2020 12:21 .gitignore Update gitignore July 5, 2019 19:16 .travis.yml Build a single test executable February 27, 2020 12:21 CMakeLists.txt Add CMakeLists July 5, 2019 19:15 LICENSE Consistently use the Boost Software License June 21, 2020 13:59 README.md Update readme November 1, 2020 21:25 View code Grisu / Dragon Ryu Schubfach Dragonbox Benchmarks README.md Build Status Build status codecov Converting binary floating-point to decimal floating-point numbers. --------------------------------------------------------------------- Grisu / Dragon Contains an implementation of the Grisu2 and Grisu3 algorithms as described in * Loitsch, Printing Floating-Point Numbers Quickly and Accurately with Integers, The Grisu3 implementation uses the Dragon4 algorithm as a fallback. * Steele, White, How to Print FloatingPoint Numbers Accurately, * Burger, Dybvig, Printing Floating-Point Numbers Quickly and Accurately, Ryu Contains an implementation of the Ryu algorithm as described in * Adams, Ryu: fast float-to-string conversion, The implemenation also contains a (fast!) strtod implementation, which can be used to convert decimal numbers with at most 17 significant decimal digits back into binary floating-point numbers. (Note that none of the algorithms here will ever produce more than 17 significant digits.) Schubfach Contains an implementation of the Schubfach algorithm as described in * Giulietti, The Schubfach way to render doubles The name of this algorithm "deliberately departs from a long lineage of fabulous drakes". Dragonbox Contains a slightly modified version the reference implementation of Junekey Jeon's Dragonbox algorithm. --------------------------------------------------------------------- Grisu3, Ryu, Schubfach, and Dragonbox are optimal, i.e. the output string 1. rounds back to the input number when read in, 2. is as short as possible, 3. is as close to the input number as possible. These algorithms (currently) assume that the input rounding algorithm uses round-to-nearest-even to break ties. Grisu2 only is optimal for ~99% of all floating point numbers, though it guarantees the first property for all of its inputs, regardless of how the input rounding mode breaks ties. --------------------------------------------------------------------- Benchmarks Benchmarks were run on an Intel Core i7-9750H, using Visual Studio 2019 16.7.7, Clang 10.0, 64-bit. Timings are in ns. --------------------------------------------------------------------- For this benchmark uniformly distributed random doubles in the range [1,2] have been generated. These numbers were then rounded to N significant digits and converted to decimal using the given algorithm. BenchDigits --------------------------------------------------------------------- Uniformly distributed random numbers in the range [10^i, 10^(i+1)] for i=-12,...,12. BenchUniform --------------------------------------------------------------------- Uniformly distributed random numbers in the range [0, 10^10]. Each benchmark is run 10 times (using different numbers each run). BenchUniformE10 --------------------------------------------------------------------- Random bit patterns. Each benchmark is run 10 times (using different numbers each run). BenchRandom About Different algorithms for converting binary to decimal floating-point numbers Topics ryu floating-point dtoa grisu2 grisu3 dragon4 Resources Readme License BSL-1.0 license Stars 76 stars Watchers 5 watching Forks 7 forks Releases No releases published Packages 0 No packages published Languages * C++ 90.2% * C 5.7% * Python 3.9% * CMake 0.2% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.