Incautious use of integer arithmetic to calculate a value for assignment to a floating-point variable can lead to loss of information. Recall, for example, that integer arithmetic always produces integral results, discarding information about any possible fractional remainder. Furthermore, there can be loss of precision when converting integers to floating-point values. See rule NUM13-J. Avoid loss of precision when converting primitive integers to floating-point for additional information. Correct programming of expressions that mix integer and floating-point operations or values requires careful consideration.
...
Note that the calculation for c violates rule NUM00-J. Detect or prevent integer overflow.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="04320b9f4209da8c-b5ff5111-470341a3-859ea26b-8b50963ccd6150b7938d6e28"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. References#JLS 05]] | [[§5.1.2, "Widening Primitive Conversion" | http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.2] | ]]></ac:plain-text-body></ac:structured-macro> |
...