The reason is that floating point numbers are composed of two parts: exponent and mantissa. After floating point numbers are converted into binary and participate in calculations, the conversion process will become unpredictable and irreversible The second situation you mentioned It just happened that no accuracy loss was noticed during the conversion process
The reason is that floating point numbers are composed of two parts: exponent and mantissa. After floating point numbers are converted into binary and participate in calculations, the conversion process will become unpredictable and irreversible
The second situation you mentioned It just happened that no accuracy loss was noticed during the conversion process
This problem is not limited to Java, other languages may also have this problem.