Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 706 Bytes

radix.md

File metadata and controls

44 lines (34 loc) · 706 Bytes

radix

  • limits[meta header]
  • std[meta namespace]
  • numeric_limits[meta class]
  • variable[meta id-type]
// C++03
static const int radix;

// C++11
static constexpr int radix;

概要

digitsを表現する基数を示す

#include <iostream>
#include <limits>

int main()
{
  constexpr int d = std::numeric_limits<int>::radix;
  constexpr int c = std::numeric_limits<char>::radix;
  constexpr int f = std::numeric_limits<double>::radix;

  std::cout << "int : " << d << std::endl;
  std::cout << "char : " << c << std::endl;
  std::cout << "double : " << f << std::endl;
}
  • radix[color ff0000]

出力例

int : 2
char : 2
double : 2