测试类型是否能确定值因过小而无法表示为一个正常化的值在舍入之前。
static const bool tinyness_before = false;
返回值
true,如果该类型可以在舍入之前检测细微的值; false,则不能。
备注
可以检测tinyness的类型包括为与IEC 559位浮点表示及其实现的选项可能影响某些结果。
示例
// numeric_limits_tinyness_before.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float types can detect tinyness before rounding: "
<< numeric_limits<float>::tinyness_before
<< endl;
cout << "Whether double types can detect tinyness before rounding: "
<< numeric_limits<double>::tinyness_before
<< endl;
cout << "Whether long int types can detect tinyness before rounding: "
<< numeric_limits<long int>::tinyness_before
<< endl;
cout << "Whether unsigned char types can detect tinyness before rounding: "
<< numeric_limits<unsigned char>::tinyness_before
<< endl;
}
要求
标头: <limits>
命名空间: std