Converting Binary Floating‐Point Numbers to Shortest Decimal Strings: An Experimental Review

ABSTRACT Background When sharing or logging numerical data, we must convert binary floating‐point numbers into their decimal string representations. For example, the number π might become 3.1415927. Engineers have perfected many algorithms for producing such accurate, short strings. Aims We present an empirical comparison across diverse hardware architectures and datasets. Methods We benchmarked several established and recent algorithms for converting binary floating‐point numbers (IEEE 754 double‐precision) to their decimal string representations. We executed the conversions across multiple CPU microarchitectures, including recent Intel (Alder Lake, Skylake), AMD (Zen 3, Zen 4), and ARM (Apple M1/M2, Neoverse) processors, using recent versions of GCC, Clang, and platform‐specific compilers and several datasets. Results and Conclusions Cutting‐edge techniques like Schubfach and Dragonbox achieve up to a tenfold speedup over Steele and White's Dragon4, executing as few as 210 instructions per conversion compared to Dragon4's 1500–5000 instructions. Often per their specification, none of the implementations we surveyed consistently produced the shortest possible strings—some generate outputs up to 30% longer than optimal. We find that standard library implementations in languages such as C++ and Swift execute significantly more instructions than the fastest methods, with performance gaps varying across CPU architectures and compilers. We suggest some optimization targets for future research.

Authors

Institutions

Publication Details

Journal
Software Practice and Experience
Published
2026-01-29
DOI
https://doi.org/10.1002/spe.70056
Primary Topic
Numerical Methods and Algorithms
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Converting Binary Floating‐Point Numbers to Shortest Decimal Strings: An Experimental Review

Daniel Lemire, Jaël Champagne Gareau
Software Practice and Experience
Numerical Methods and Algorithms
article

Converting Binary Floating‐Point Numbers to Shortest Decimal Strings: An Experimental Review

Daniel Lemire, Jaël Champagne Gareau
article en

Abstract

ABSTRACT Background When sharing or logging numerical data, we must convert binary floating‐point numbers into their decimal string representations. For example, the number π might become 3.1415927. Engineers have perfected many algorithms for producing such accurate, short strings. Aims We present an empirical comparison across diverse hardware architectures and datasets. Methods We benchmarked several established and recent algorithms for converting binary floating‐point numbers (IEEE 754 double‐precision) to their decimal string representations. We executed the conversions across multiple CPU microarchitectures, including recent Intel (Alder Lake, Skylake), AMD (Zen 3, Zen 4), and ARM (Apple M1/M2, Neoverse) processors, using recent versions of GCC, Clang, and platform‐specific compilers and several datasets. Results and Conclusions Cutting‐edge techniques like Schubfach and Dragonbox achieve up to a tenfold speedup over Steele and White's Dragon4, executing as few as 210 instructions per conversion compared to Dragon4's 1500–5000 instructions. Often per their specification, none of the implementations we surveyed consistently produced the shortest possible strings—some generate outputs up to 30% longer than optimal. We find that standard library implementations in languages such as C++ and Swift execute significantly more instructions than the fastest methods, with performance gaps varying across CPU architectures and compilers. We suggest some optimization targets for future research.

Software Practice and ExperienceVol. 56(4)
Université du Québec à Montréal (CA), Université TÉLUQ (CA)
Natural Sciences and Engineering Research Council of Canada
Openalex Percentile: Top 72%
Numerical Methods and Algorithms
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.