![]() ![]() Dragonbox just outputs two integers (the decimal significand/exponent) that can be consumed by a string generation procedure. #Dragonbox dragonball project how to#How to UseĪlthough Dragonbox is intended for float-to-string conversion routines, the actual string generation is not officially a part of the algorithm. Since another name of the pigeonhole principle is Dirichlet's box principle, I decided to call my algorithm "Dragonbox" to honor its origins: Schubfach (box) and Grisu (dragon). The name Schubfach is coming from the German name of the pigeonhole principle, Schubfachprinzip, meaning "drawer principle". The core idea of Schubfach, which Dragonbox is based on, is a continuous analogue of discrete pigeonhole principle. The output is correctly rounded: the number generated by Dragonbox is the closest to the actual value of the input number among possible outputs of minimum number of digits. The output is of the shortest length that is, no other output strings that are interpreted as the input number can contain less number of significand digits than the output of Dragonbox. It has the roundtrip guarantee that is, a correct parser interprets the generated output string as the original input floating-point number. These integers can then be used for string generation of decimal representation of the input floating-point number, the procedure commonly called ftoa or dtoa. Introductionĭragonbox generates a pair of integers from a floating-point number: the decimal significand and the decimal exponent of the input floating-point number. Dragonbox is further inspired by Grisu and Grisu-Exact. This library is a reference implementation of Dragonbox in C++.ĭragonbox is a float-to-string conversion algorithm based on a beautiful algorithm Schubfach, developed by Raffaello Giulietti in 2017-2018. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |