numeric_limits::digits10
Zwraca liczbę cyfr dziesiętnych, które typ może reprezentować bez utratę precyzji.
static const int digits10 = 0;
Wartość zwracana
Liczba cyfr dziesiętnych, które typ może reprezentować bez utratę precyzji.
Przykład
// numeric_limits_digits10.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << numeric_limits<float>::digits10 <<endl;
cout << numeric_limits<double>::digits10 <<endl;
cout << numeric_limits<long double>::digits10 <<endl;
cout << numeric_limits<int>::digits10 <<endl;
cout << numeric_limits<__int64>::digits10 <<endl;
float f = (float)99999999;
cout.precision ( 10 );
cout << "The float is; " << f << endl;
}
Wymagania
Nagłówek:<limity>
Przestrzeń nazw: std