Issue with default rounding numbers in Processing Java Mode

The result you get is not too surprising, because the pre-processor does not know how to deal with the numbers (are they integer are they float). You need to give it a bit of help:-

float b=(10+(500/1000.0f))/60;
float a=(2+b)*6;
println(a);
println(nf(1/3.0f, 2, 10));

But even then the result is bit strange

 13.049999
00.3333333433                                                                                                                                                                                                          
2 Likes