Calculating with fractions

I got a problem in Processing. i want to define a variable to be 1/60. But if I look in the Console it always says, that the variable is 0. Last time I tried this (about one year ago) it worked perfectly. How do i fix this?


Can you reproduce this?

You are doing integer math:
Integer Division -- from Wolfram MathWorld

Try 1.0/60 and see what happens.

Make sure that you declare your variables correctly as well.

int / Reference /
float / Reference /



Thank you very much. It worked, but last time i tried this i didn´t had to write 1.0