Division in Java always results in zero (0)? [duplicate]

You’re doing integer division.

You need to cast one operand to double.

Leave a Comment