Partager via


numeric_limits::radix

Returns the integral base, referred to as radix, used for the representation of a type.

static const int radix = 0;

Return Value

The integral base for the representation of the type.

Remarks

The base is 2 for the predefined integer types, and the base to which the exponent is raised, or FLT_RADIX, for the predefined floating-point types.

Example

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

using namespace std;

int main( )
{
   cout << "The base for type float is:  "
        << numeric_limits<float>::radix
        << endl;
   cout << "The base for type int is:  "
        << numeric_limits<int>::radix
        << endl;
   cout << "The base for type long double is:  "
        << numeric_limits<long double>::radix
        << endl;
}
The base for type float is:  2
The base for type int is:  2
The base for type long double is:  2

Requirements

Header: <limits>

Namespace: std

See Also

Reference

strstreambuf Class