How to Quickly Convert Floating-Point Numbers in C++
summary
Introduces Dragonbox, a new algorithm that outputs decimal shortest-roundtrip strings, implements round-trip safety with explicit permissible-interval math and round‑to‑even tie rules, and replaces expensive per-number divisions by precomputed rational approximations and lookup tables. Compares wall‑clock timings to Jaguar, Ryu/Grisu family and shows distributional results across all doubles, finding Dragonbox wins many cases but trades simplicity for rare slowdowns; reports the fraction of uncentered values around 14% and publishes full measurements and slides.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 2:32Floating-point conversion matters
- 4:43Binary format
- 10:13Binary floating-point
- 16:381/3 result in C++
- 20:39Dragon algorithm history
- 24:01Dragon algorithm requirements
- 30:56Jaguar algorithm
- 36:12Jaguar algorithm F
- 42:58Optimizing Jaguar in C++
- 47:03Performance vs Dragon Box
- 51:06Conclusion & Q&A
related talks
36mHere be Floating Dragons: A Tale of Making OTP Faster
51mFloating-Point Arithmetic on Deterministic Systems
01h 00mFloating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss
48mFuture-Proofing Numerical Accuracy with Formal Specifications
47mBenchmarking C++, From video games to algorithmic trading
31mBenchmarking and Optimization of Rust Libraries
38mStrength in Numbers: Unums and the Quest for Reliable Arithmetic
01h 11m“Benchmarking C++ Code"
