A
Adam Majewski
Hi,
I have seen code that compers like that :
if (b == 0.0 && (a == 0.25 || a == -0.75))
so I have checked it :
#include <iostream>
using namespace std;
int main() {
cout << boolalpha
<< "The true expression 0.25 == 0.25000000000000001 yields : "
<< (0.25 == 0.25000000000000001) << endl
<< "The false expression 0.25 == 0.2500000000000001 yields: "
<< (0.25 == 0.2500000000000001) << endl;
}
Is it operator overloadin ? Is it good code ?
TIA
Adam
I have seen code that compers like that :
if (b == 0.0 && (a == 0.25 || a == -0.75))
so I have checked it :
#include <iostream>
using namespace std;
int main() {
cout << boolalpha
<< "The true expression 0.25 == 0.25000000000000001 yields : "
<< (0.25 == 0.25000000000000001) << endl
<< "The false expression 0.25 == 0.2500000000000001 yields: "
<< (0.25 == 0.2500000000000001) << endl;
}
Is it operator overloadin ? Is it good code ?
TIA
Adam