0

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

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Salem
0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.