numeric_limits::has_quiet_NaN
測試型別是否具有沉寂的表示不是數字, nonsignaling (NAN)。
static const bool has_quiet_NaN = false;
傳回值
true ,如果有 type 安靜 NaN 的表示, false ,否則為。
備註
安靜 NaN 不是數字的編碼,並未通知它在運算式的存在。 is_iec559 ,如果為 true,則傳回值為 true 。
範例
// numeric_limits_has_quiet_nan.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have quiet_NaN: "
<< numeric_limits<float>::has_quiet_NaN
<< endl;
cout << "Whether double objects have quiet_NaN: "
<< numeric_limits<double>::has_quiet_NaN
<< endl;
cout << "Whether long int objects have quiet_NaN: "
<< numeric_limits<long int>::has_quiet_NaN
<< endl;
}
需求
標題: <limits>
命名空間: std