Jan 4 in C++
Q: Digit separators C++ 14 Feature

1 Answer

Jan 4

In C++14, the single-quote character may be used arbitrarily as a digit separator in numeric literals, both integer literals and floating point literals.This can make it easier for human readers to parse large numbers through subitizing.

auto integer_literal = 1'000'000;

auto floating_point_literal = 0.000'015'3;

auto binary_literal = 0b0100'1100'0110;

auto silly_example = 1'0'0'000'00;

Click here to read more about C++
Click here to read more about Insurance

Related questions

Jan 4 in C++
Jan 4 in C++
May 27, 2019 in Other