numeric_limits::epsilon

函数返回介于 1 和大于最小值之间的区别对于数据类型能够可用的大于 1。

static Type epsilon( ) throw( );

返回值

介于 1 和大于最小值之间的区别对于数据类型能够可用的大于 1。

备注

值为类型 浮动FLT_EPSILON。 类型epsilon 是最小的浮点数。" 这样 N + epsilon + N 是一种可用的。

示例

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

using namespace std;

int main( )
{
   cout << "The difference between 1 and the smallest "
        << "value greater than 1\n for float objects is: " 
        << numeric_limits<float>::epsilon( ) 
        << endl;
   cout << "The difference between 1 and the smallest "
        << "value greater than 1\n for double objects is: " 
        << numeric_limits<double>::epsilon( ) 
        << endl;
   cout << "The difference between 1 and the smallest "
        << "value greater than 1\n for long double objects is: " 
        << numeric_limits<long double>::epsilon( ) 
        << endl;
}
  

要求

页眉: <限制>

命名空间: std

请参见

参考

strstreambuf 类