Поделиться через


numeric_limits::digits10

Возвращает количество десятичных разрядов, тип может представлять без потери точности.

static const int digits10 = 0;

Возвращаемое значение

Количество десятичных разрядов, тип может представлять без потери точности.

Пример

// 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;
}
  

Требования

заголовок: <limits>

std пространство имен:

См. также

Ссылки

strstreambuf Class