+ 1
JAVA How it was true?
5 Respostas
+ 5
Numeric literals which begin with 0 are octal. The decimal representation of 053 is 43.
(8^0 * 3) + (8^1 * 5) = 43
+ 5
Rael , numbers prefixed with 0 are octal system numbers, so when 053 is converted to decimal system it is 43 (3*8^0 + 5*8 ^1 + 0* 8^2 => 43).
+ 5
From section 3.10.1 of the JLS:
An octal numeral consists of an ASCII digit 0 followed by one or more of the ASCII digits 0 through 7 interspersed with underscores, and can represent a positive, zero, or negative integer.
https://code.sololearn.com/cBINiU6wOFoT/?ref=app
+ 3
No, it is just some Mathematics.
053 is not decimal (base 10), because it starts with 0, it is octal (base 8).
If you understand binary, for example, 1011(bin) === 1*8 + 0*4 + 1*2 + 1*1
You can understand octal, for example, 0643(oct) === 6*64 + 4*8 + 3*1
0
Uh it was so complicated for me,does this is compulsory for everyone to know it?