This is the mail archive of the gcc-bugs@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: c++/10902: comparing doubles is not consistent in gcc 3.3 (SuSE version)


Just a small addition to the bug report.

Compiling with -ffloat-store does not alleviate the problem.

This problem is not a problem of too much precision, but one of too little 
precision.

The following comparison is true in gcc 3.3 (SuSE prerelease):

double(1) == double(1) - 134217728*DBL_EPSILON

According to the definition in <cfloat>, DBL_EPSILON is the smallest number 
for which 1 - DBL_EPSILON != 1.


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