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