This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: real.c implementation
- From: Stephen L Moshier <steve at moshier dot net>
- To: Brad Lucier <lucier at math dot purdue dot edu>, <gcc at gcc dot gnu dot org>
- Date: Fri, 25 Oct 2002 22:05:56 -0400 (EDT)
- Subject: Re: real.c implementation
> I don't know the answers to these questions. Steele and White,
> Clinger, and David Gay (his code is at netlib.org) worked out
> provably correct methods to do exact binary<->decimal conversion.
> All of them rely on extra-precision integer arithmetic for some
> cases.
Gay's program is in the GCC java library subdirectory. It used
to be in the C++ library also; I remember chasing a bug in it.
Dewar has mentioned that the GCC Ada front end does correctly rounded
conversions. Glibc, the GNU system library, has been through
several decimal converters; currently it has a correctly rounded
method that uses the GNU multiple precision library (gmp). I think
that gmp can also be used as a floating point emulator.
The C language standard references IEEE. Some months ago the IEEE 754
revision committee posted some messages to the effect that they were
going to require a correctly rounded method, but then they seemed to
withdraw that. As a practical matter, conversion according to IEEE is
already correctly rounded over a wide domain that covers the vast
majority of real programs, and the largest allowable error is less
than twice the error of correct rounding; so the distinction is minor.