Why is numeric_limits<int>::max() > numeric_limits<int>::infinity()?
问题 I was reading Setting an int to Infinity in C++. I understand that when one needs true infinity, one is supposed to use numeric_limits<float>::infinity() ; I guess the rationale behind it is that usually integral types have no values designated for representing special states like NaN , Inf , etc. like IEEE 754 floats do (again C++ doesn't mandate neither - int & float used are left to the implementation); but still it's misleading that max > infinity for a given type. I'm trying to