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

issue with integer division of zero padded integers

$
0
0
Processing 2.0b6 on Linux Ubuntu 12.04

While
println(3456/10);
gives : 345

println(03456/10);
answers : 183

and the same with :
println(003456/10); ->183
and
println(0003456/10); ->183

and same problem with integer numerator and float denominator:
println(03456/10.0); ->183.8

while 0 padded float division seams OK :
println(03456.0/10.0); -> 345.6

Even stranger with
println(08765/10);
giving following error:
unexpected token: 8765

Any reason for this amazing behavior ?

Viewing all articles
Browse latest Browse all 1768

Trending Articles