It is often important to be able to read back a written floating-point
number accurately so it has to be output with high enough precision.
The Scheme standard even demands this for the number->string and
string->number procedures. Moreover, for output, the shortest rounded
representation that still reads back accurately has to be selected.

Such input and output routines for floats and doubles would also be
very helpful in the C language. Do you think this could become a
Gnulib module?

A simple algorithm is given by Aubrey Jaffer in [1].

Marc

[1] http://people.csail.mit.edu/jaffer/III/EZFPRW

Reply via email to