This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: real.c fails floating point tests
- From: dewar at gnat dot com (Robert Dewar)
- To: gcc at gcc dot gnu dot org, steve at moshier dot net
- Date: Wed, 16 Oct 2002 10:47:08 -0400 (EDT)
- Subject: Re: real.c fails floating point tests
> Decimal <-> binary conversion is the most important floating point
> operation for the compiler, since there is no portable alternative but
> to write decimal numbers (the ugly C99 hexadecimal input will become
> generally available only in the distant future) and hope that they
> will be converted with sufficient accuracy into binary machine
> numbers. I have reported some errors for this in the current GCC, and
> have also noticed that the decimal conversion method suffers from
> double-rounding error (test case to follow later).
Wouldn't it always be better to write out floating-point constants in
hex in the assembler file. You definitely cannot trust assemblers to
be absolute accuracy (absolute accuracy in such conversions is required
in Ada, and desirable in other languages).