Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Integer type ranges are defined by the JLS, §4.2.1, "Integral Types and Values" [JLS 2005], and are also described in rule NUM00-J. Detect or prevent integer overflow.

...

Narrower primitive types can be cast to wider types without affecting the magnitude of numeric values (see the JLS, §5.1.2, Widening Primitive Conversion" [JLS 2005]), for more information). Conversion from int or long to float or from long to double can lead to loss of precision (loss of least significant bits). No runtime exception occurs despite this loss.

...

...