numeric_limits::epsilon
İşlevi 1 ve en küçük değeri arasındaki farkı gösterilebilir veri türü için 1'den büyük verir.
static Type epsilon( ) throw( );
Dönüş Değeri
1 Gösterilebilir veri türü için 1'den büyük olan en küçük değer arasındaki fark.
Notlar
Değer türü için FLT_EPSILON olan float.epsilonen küçük pozitif bir kayan noktalı sayı türü için n , n + epsilon + n gösterilebilir değil.
Örnek
// 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;
}
Gereksinimler
Başlık: <limits>
Namespace: std