This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ optimization issue??


Dave Korn wrote:

  Because it isn't possible?  FP is not real mathematics over the rational
number field, it is a finite approximation.  If you really want absolute
precision and accuracy, you need to use a proper arbitrary-precision bignum
library, such as GMP.

Well that could be a little misleading. Floating-point is not some murky approximation of real arithmetic on a modern IEEE compatible system. The results of IEEE arithmetic are after all extremely well defined, just as well defined as real arithmetic.

The issue in cases like this is how the language maps into IEEE operations,
and there are two questions:

1. What do users expect in practice

2. What does the standard require

Users clearly don't expect extended precision effects (indeed Kahan
complained that extra precision in a Fortran compiler was a plain
bug, and I remember discussing this issue with him, and he was simply
unwilling to accept that the Fortran standard permitted the clearly
"wrong" behavior he was seeing.

Standards have only just started to address the issue clearly (the
IEEE standard itself does not have to say much about this mapping).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]