Why is 025 === 21 true in many programming languages?
Asked by Sai Siva Kumar about a year ago
How and why 025 === 21 is true?
It evalutes true in every programming language, what is the reson behind it.
Haha interesting question!
This has to do with the Octal number system! Basically, In many programming languages, an Octal number is represented by preceding with "0", thus the value in Octal can be written as
025 (which is equivalent to
21 in Decimal).
You can check the conversion result here: https://decimal-to-binary.com/decimal-to-binary-converter-online.html?id=25621