这可以分配NaN给一个double或float在C/C++中吗?就像你在JavaScript中一样:a = NaN.所以稍后您可以检查变量是否为数字.
NaN
double
float
a = NaN
c++ nan
c++ ×1
nan ×1