B
better_cs_now
Hello all,
The code below outputs "FALSE" on my platform. Does the language
guarantee this behavior?
Thanks,
Dave
#include <iostream>
#include <limits>
using namespace std;
int main()
{
double Result;
try
{
Result = numeric_limits<double>::quiet_NaN(); // 1.#QNAN
if (Result == numeric_limits<double>::quiet_NaN())
cout << "TRUE" << endl;
else
cout << "FALSE" << endl;
}
catch(...)
{
cout << "Exception!!!" << endl;
}
}
The code below outputs "FALSE" on my platform. Does the language
guarantee this behavior?
Thanks,
Dave
#include <iostream>
#include <limits>
using namespace std;
int main()
{
double Result;
try
{
Result = numeric_limits<double>::quiet_NaN(); // 1.#QNAN
if (Result == numeric_limits<double>::quiet_NaN())
cout << "TRUE" << endl;
else
cout << "FALSE" << endl;
}
catch(...)
{
cout << "Exception!!!" << endl;
}
}