I ran this:

cout << "has nan q?" << numeric_limits<int>::has_quiet_NaN << endl;
	cout << "has nan s?" << numeric_limits<int>::has_signaling_NaN << endl;
	cout << "has nan q?" << numeric_limits<double>::has_quiet_NaN << endl;
	cout << "has nan s?" << numeric_limits<double>::has_signaling_NaN << endl;

and I get
0
0
1
1

why would int not have NaN?? I'm using g++.

Thanks!

Dave

The standard doesn't rule out the possibility that integers can have traps like NaN's, it's just that your implementation doesn't have them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.