Export (0) Print
Expand All

numeric_limits::digits

Returns the number of radix digits that the type can represent without loss of precision.

static const int digits = 0;

The number of radix digits that the type can represent without loss of precision.

The member stores the number of radix digits that the type can represent without change, which is the number of bits other than any sign bit for a predefined integer type, or the number of mantissa digits for a predefined floating-point type.

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

using namespace std;

int main( )
{
   cout << numeric_limits<float>::digits <<endl;
   cout << numeric_limits<double>::digits <<endl;
   cout << numeric_limits<long double>::digits <<endl;
   cout << numeric_limits<int>::digits <<endl;
   cout << numeric_limits<__int64>::digits <<endl;
}
24
53
53
31
63

Header: <limits>

Namespace: std

Show:
© 2014 Microsoft