...
Note that conversions from float
to double
can also lose information about the overall magnitude of the converted value. Specifically, on platforms whose native floating point hardware provides greater precision than double
, the JIT is permitted to use floating point registers to hold values of type float
( or type double
(in the absence of the strictfp
modifier), even though the registers support values with greater mantissa and/or exponent range than that of the primitive types. Consequently, conversion from float
to double
can cause an effective loss of precision, of magnitude, or of both. However, the lost precision or magnitude would also have been lost if the value were stored to memory, for example to a field of type float
. See guideline FLP04-J. Use the strictfp modifier for floating point calculation consistency for additional information.
...