...
Conversion from int
or long
to float
, or long
to double
can lead to loss of precision (loss of least significant bits). In this case, the resulting floating-point value is a rounded version of the integer value, using IEEE 754 round-to-nearest mode. Despite this loss of precision, the Java Language Specification requires that the conversion and rounding occur silently, that is, without any runtime exception. See the JLS, §5.1.2, "Widening Primitive Conversion" for more information. ThereforeConsequently, any conversion from an int
or long
to a floating-point type, or from long
to double
must be checked against the range that the flowting-point type can precisely represent.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7bc98014a749e983-5e965074-49dc4b19-9571a162-b041148e680f0933f6e4739e"><ac:plain-text-body><![CDATA[ | [[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> |
...