In https://github.com/cpp-tutor/learnmoderncpp-tutorial/blob/main/02-variables-scopes-and-namespaces.md.
"Now change {1} to {1LL}. Does the code still compile? Try to fix this."
I tried and it compiled. I believe that the above sentence should be adjusted.
`#include
using namespace std;
int main() {
int c = {static_cast(2.5)};
// LL is long long int.
// This compiles because the value 1 can be exactly represented as a double.
double d = {1LL};
println("c = {}, d = {}", c, d);
// 2^53 + 1 — not exactly representable.
// 2^53 + 1 exceeds the 53-bit mantissa of double, so it rounds — and that
// rounding is what the brace-init rule forbids.
//
// error: narrowing conversion of ‘9007199254740993’ from ‘long long int’ to
// ‘double’ [-Wnarrowing]
// double e = {9007199254740993LL};
}`
In https://github.com/cpp-tutor/learnmoderncpp-tutorial/blob/main/02-variables-scopes-and-namespaces.md.
"Now change {1} to {1LL}. Does the code still compile? Try to fix this."
I tried and it compiled. I believe that the above sentence should be adjusted.
`#include
using namespace std;
int main() {
int c = {static_cast(2.5)};
// LL is long long int.
// This compiles because the value 1 can be exactly represented as a double.
double d = {1LL};
println("c = {}, d = {}", c, d);
// 2^53 + 1 — not exactly representable.
// 2^53 + 1 exceeds the 53-bit mantissa of double, so it rounds — and that
// rounding is what the brace-init rule forbids.
//
// error: narrowing conversion of ‘9007199254740993’ from ‘long long int’ to
// ‘double’ [-Wnarrowing]
// double e = {9007199254740993LL};
}`