Fast Conversion From Cpp Floating Point Numbers
summary
Presents a new algorithm called TJaguar that converts binary floats to the shortest round‑trip decimal faster than previous dragons (Grisu, Ryu, Dragonbox, Errol) by picking the largest decimal exponent f that fits a permissible interval. Uses a precomputed power table (K-bit entries), integer mantissa shifting, and divisibility checks via the Mersenne modular inverse; a code generator produces tables and a computer‑assisted proof covers doubles. Benchmarks report TJaguar wins for 99.95% of centered doubles and beats Dragonbox on integer cases 100% of the time while preserving round‑trip correctness.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 2:35The problem
- 4:48Scientific notation
- 7:46Decimal floating point
- 14:04Binary floating point
- 18:24Decoding binary numbers
- 23:43Printing floating points
- 27:23Rounding and ambiguity
- 31:28The dragon algorithm
- 34:07Algorithms history
- 36:52Ryu and DragonBox
- 39:11The dragon's problem
- 1:00:04Conclusion
related talks
57mFloating-Point to String Conversion in C++: Exploring Algorithms & Performance
11mPrinting floating point numbers is surprisingly hard!!
01mTalk Preview: A new dragon in the den: fast conversion from floating-point numbers
14mPrinting Floating Numbers is Surprisingly Hard!
58mPortable floating-point calculations
01h 00mFloating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss
26mGenerating Correctly Rounded Math Libraries for New Floating Point Variants
22mJulia - Dynamism and Performance Reconciled by Design
