Python: Invalid Token
I think when you start a literal number with a 0, it interprets it as an octal number and you can’t have an ‘8’ in an octal number.
I think when you start a literal number with a 0, it interprets it as an octal number and you can’t have an ‘8’ in an octal number.
Yes, 0 is an Octal literal in C++. As per the C++ Standard: 2.14.2 Integer literals [lex.icon] integer-literal: decimal-literal integer-suffixopt octal-literal integer-suffixopt hexadecimal-literal integer-suffixopt decimal-literal: nonzero-digit decimal-literal digit octal-literal: 0 <——————–<Here> octal-literal octal-digit
This is a common Javascript gotcha with a simple solution: Just specify the base, or ‘radix’, like so: parseInt(’08’,10); // 8 You could also use Number: Number(’08’); // 8