What is caused by leading 0 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is caused by leading 0

14/2 = 7 014/2= 6 can someone please explain what happens? thank you

11th Mar 2017, 7:40 PM
Kris
3 Answers
+ 17
14 is decimal while 014 is octal, which is 12 in decimal. "To use octal notation, precede the number with a 0 (zero). To use hexadecimal notation precede the number with 0x. To use binary notation precede the number with 0b." Source: http://php.net/manual/en/language.types.integer.php
11th Mar 2017, 11:19 PM
Jafca
Jafca - avatar
+ 14
@Kris Try again 😋
12th Mar 2017, 2:04 AM
Jafca
Jafca - avatar
+ 1
cool - somehow when I click on thumbs up I get a no connection message. So: *thumbs up*
11th Mar 2017, 11:50 PM
Kris