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 "NUM14NUM13-J. Beware of precision loss 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.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9d6687f99a10039c-ec6e50de-4c1d486b-b5d597c3-6d49bb7a3319e89125846634"><ac:plain-text-body><![CDATA[ | [java:[JLS 2005 | AA. Bibliography#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> |
...
03. Numeric Types and Operations (NUM) NUM14NUM13-J. Beware of precision loss when converting primitive integers to floating-point