Trick question
May 15, 2012
I just came up with a trick question. Let’s see if you can solve it.
Why will 20 become smaller when you add another zero?
Update: Commenters have been very creative. My original solution was to add the zero at the front, yielding “020”, which is 16 in many programming languages. Other solutions are “20^0 = 1” include “0.20”.
May 15, 2012 at 14:17
by convention, 20 is decimal and 020 is octal
May 15, 2012 at 14:26
Because 020 is octal for 16d?
May 15, 2012 at 14:28
20^0 = 1
May 15, 2012 at 14:37
020 is octal notation stands for 16 in decimal notation
May 15, 2012 at 14:38
The typical smartypants answer is “because I added it to the left”, but since it requires adding a period too for it to make sense, I guess it’s not what you’re looking for.
May 15, 2012 at 14:45
Because in the C language 020 is 16 in base 10.
May 15, 2012 at 15:05
20⁰ (20 exponent 0) = 1, also.
May 15, 2012 at 15:09
20^0
May 15, 2012 at 15:18
Depends on the meaning of “add”, you can add a 0 as exponent and get 1 😀
May 15, 2012 at 15:19
(char)20 > (char)200
May 15, 2012 at 15:26
Because KR made a stupid mistake? The octal notation should have been killed with fire a long time ago..
May 15, 2012 at 17:04
The problem is not the octal notation, the problem is not using an alphabetical character for markup like in the case of hex.
o20 or c20 or whatever
May 16, 2012 at 10:51
Then it is a problem with octal notation, simply because bad prefix was chosen.
May 16, 2012 at 13:12
I’ve should have said “this octal notation” in staid of “the”.
May 15, 2012 at 15:45
20º = 1
May 15, 2012 at 16:17
yay for `chmod 0x1c0 /root`
May 15, 2012 at 19:37
20^0=1