Floating-Point Printing and Parsing Can Be Simple And Fast (Floating Point Formatting, Part 3)
Floating-Point Printing and Parsing Can Be Simple And Fast
Russ Cox
January 19, 2026
research.swtch.com/fp
Posted on Monday, January 19, 2026.
PDF
Introduction
A floating point number f has the form f=m·2e
where m is called the mantissa
and e is a signed integer exponent.
We like to read numbers scaled by powers of ten,
not two, so computers need algorithms to convert binary floating-point
to and from decimal text.
My 2011 post “Floating Point to Decimal Conversion is Easy”
argued that these co...
Read more at research.swtch.com