9fans archive / 2001 / 10 / 639 /    prev next

From: Eric Grosse <ehg@res...>
Subject: Re: [9fans] double->string conversion
Date: Fri, 26 Oct 2001 16:45:08 -0400

The %f, %g, strtod functions in both Inferno and 3rd edition Plan 9
are intended to be accurate.   (The version in 2nd edition is known
to be less exact.)

The one in Inferno comes from David Gay and is the more heavily tested;
see http://plan9.bell-labs.com/netlib/fp/.

The one in Plan 9 (/sys/src/libc/port/fltconv.c and strtod.c) is by
Ken Thompson and should give the same conversion.  It is shorter but
probably not as fast.   If you find accuracy problems with either
one, please let me know.

Eric