Why is this basic equality test failing?

Posted by Goose Bumper on Stack Overflow See other posts from Stack Overflow or by Goose Bumper
Published on 2010-05-15T22:30:57Z Indexed on 2010/05/15 22:40 UTC
Read the original article Hit count: 280

Filed under:

I have a pointer m to an object, and calling m->det() returns 14 (the return type is a double). Why would the following statement evaluate to false?

cout << (m->det()==14) << endl;

I just don't understand how this could be failing. Using

cout << m->det() << endl;
cout << (m->det()==14) << endl;

gives me:

14
0

© Stack Overflow or respective owner

Related posts about c++