共用方式為


numeric_limits::tinyness_before

測試類型是否無法判斷該值太小而無法表示為標準化值在捨入之前。

static const bool tinyness_before = false;

傳回值

true ,如果型別可以在捨入之前偵測小的值, false ,如果不行。

備註

可以偵測 tinyness 的類型包括以 IEC 60559:1989 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

請參閱

參考

strstreambuf Class