numeric_limits::round_error

型の最大の丸め誤差を返します。

static Type round_error( ) throw( );

戻り値

型の最大の丸め誤差。

使用例

// numeric_limits_round_error.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>

using namespace std;

int main( )
{
   cout << "The maximum rounding error for type float is:  "
        << numeric_limits<float>::round_error( )
        << endl;
   cout << "The maximum rounding error for type int is:  "
        << numeric_limits<int>::round_error( )
        << endl;
   cout << "The maximum rounding error for type long double is:  "
        << numeric_limits<long double>::round_error( )
        << endl;
}
  

必要条件

ヘッダー: <limits>

名前空間: std

参照

関連項目

strstreambuf Class