Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : issue with integer division of zero padded integers

$
0
0
Funny, because you used exactly the digits making it work (in some cases, you will get a compilation error!).
Java inherited from the C language a bizarre syntax: we can specify number in octal notation. It is nearly never used (GoToLoop found out an original usage with color shifting), but it is here.
If you prefix an integer number (with digits between 0 and 7) with a zero, you automatically trigger this octal notation.
So 031 is actually 25.
println(031 == 25); // Shows true
Making the old joke that Halloween is the same than Christmas:
Oct 31 == Dec 25
(octal vs. decimal)


Viewing all articles
Browse latest Browse all 1768

Trending Articles