This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Floating point woes
- To: gcc-help at gcc dot gnu dot org
- Subject: Floating point woes
- From: Rafael Herrera <raffo at neuronet dot pitt dot edu>
- Date: Sat, 02 Jun 2001 02:35:07 -0400
- References: <991463145.13690.ezmlm@gcc.gnu.org>
Hello,
I've inherited a program wich has started to crash after attempting to
compare floating point numbers (doubles to be precise). For example, a
construct like this:
if (a/2 > b)
{
<..>
}
would be true, even though the a/2 and b are equal.
What is the recommended procedure to compare two doubles? If not
recommended, is there a tool that can scan the sources and report the
instances in which these potentially problematic constructs occur?
Thank you
--
Rafael