Converting Binary Floating-Point Numbers to Shortest Decimal Strings: An Experimental Review
jeudi, 29 janv. 2026·
,
Jaël Champagne Gareau
Daniel Lemire
Résumé
When sharing or logging numerical data, we must convert binary floating-point
numbers into their decimal string representations. For example, the number $\pi$
might become 3.1415927. Engineers have perfected many algorithms for producing
such accurate, short strings. We present an empirical comparison across
diverse hardware architectures and datasets. 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.
Type
Publication
Software: Practice and Experience

Auteurs
Chercheur postdoctoral en informatique
Je suis actuellement chercheur postdoctoral en informatique à l’Université
TÉLUQ, où mes travaux portent sur l’accélération de la conversion de nombres
entiers et flottants en chaînes de caractères décimales. Au cours de mon
doctorat, j’ai conçu des algorithmes et des structures de données exploitant
l’architecture moderne des ordinateurs afin de résoudre de grandes instances
de processus décisionnels de Markov (MDP). Durant ma maîtrise, j’ai développé
des algorithmes de planification d’itinéraires pour véhicules électriques,
visant à déterminer le chemin optimal entre deux points tout en minimisant
le temps total du trajet (déplacement, recharge et attente aux bornes).
Auteurs