We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi coders,
i have a math question: Why does Processing print the value 3here? Wouldn't 3.6 be the correct solution??
3
3.6
float n = 360/100; println(n);
360/100
float n = 360/100.; // Notice the dot . at the end of 100! println(n); // 3.6 exit();
Don't just use a dot, use .0 - a dot is to easy to overlook.
Answers
360/100
consists of a division operation w/ 2 integer operands.Don't just use a dot, use .0 - a dot is to easy to overlook.