~/talk

Floating-Point to String Conversion in C++: Exploring Algorithms & Performance

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [compilers-and-language-design]
links:none on file
slides:none on file

Introduces a new TJaguar (Jaguar) algorithm that converts IEEE‑754 floats to decimal by decoding sign/exponent/mantissa, using precomputed power‑of‑two lookup tables and integer-only arithmetic to pick the optimal decimal exponent F, apply round‑to‑even tie breaks, strip trailing zeros and emit the shortest round‑trip string. An implementation is benchmarked on centered doubles: Jaguar is faster than Dragonbox on ~99.5% of samples and shows roughly a ~27% average speedup vs Dragonbox, with both beating older Ryu/Grisu approaches.

AI-written summary · about

  1. 0:00Hydra problem in float conversion
  2. 2:11Why float to string matters
  3. 5:03How floats are stored
  4. 12:56IEEE 754 binary representations
  5. 19:05Why 1/3 prints as 0.33333334
  6. 22:41Dragon algorithms for conversion
  7. 24:07Dragon’s problem explained
  8. 34:10Jaguar algorithm origin
  9. 37:02Jaguar algorithm step-by-step
  10. 48:35Simplifying Jaguar performance
  11. 51:26Jaguar optimizations
  12. 54:18Benchmark Jaguar vs Dragon Box vs Grisu
  13. 56:25Jaguar algorithm revealed
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.