Skip to content

Commit

Permalink
cpp14/digit_separators: 言語仕様を補記
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhoy committed Jan 28, 2025
1 parent 4fd9557 commit a4f1067
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lang/cpp14/digit_separators.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ int binary_value = 0b1000'1111;
- 桁区切り文字(digit separators)は、数値リテラルの読みやすさを向上させるため導入された、数値リテラルの間に挿入することを許可された特殊な文字である
- 桁区切り文字には、シングルクォーテーション(`'`)を使用する
- 桁区切り文字は、整数リテラルと浮動小数点数リテラルに対して使用できる
- 桁区切り文字は、リテラルの先頭に入力することはできない
- 浮動小数点数リテラルでは、小数部にも桁区切り文字を入力できる
- 桁区切り文字は、数字並びの先頭や末尾に配置したり、2個以上を連続して配置することはできない
- 浮動小数点数リテラルでは、小数部や指数部にも桁区切り文字を配置できる


##
Expand All @@ -50,7 +50,7 @@ int main()
int octal_value = 0123'456;
std::cout << octal_value << std::endl;

int hex_value = 0x123'456;
int hex_value = 0x12'34'56;
std::cout << hex_value << std::endl;

int binary_value = 0b1010'1010;
Expand Down

0 comments on commit a4f1067

Please sign in to comment.