Rendering floating-point numbers

Posted: June 29th, 2011 | Author: Mars | Filed under: Reference | 1 Comment »

Interesting reference material: it seems obvious in retrospect, but it had never occurred to me that the process of rendering a floating-point number into a string was the sort of project people might write papers about.

Here’s something I bet you never think about, and for good reason: how are floating-point numbers rendered as text strings? This is a surprisingly tough problem, but it’s been regarded as essentially solved since about 1990.

References to the “Dragon4″ algorithm, and to a recent improvement, “Grisu3″.


One Comment on “Rendering floating-point numbers”

  1. 1 Aaron Ballman said at 07:43 on July 5th, 2011:

    Oddly enough, Russ Cox just wrote about this topic recently as well:

    http://research.swtch.com/2011/07/floating-point-to-decimal-conversion-is.html