Recently, I saw a younger brother in the Group asking for help: int a = 58; double B = 0.35; double c = a * B; why is it equal to 20.29999999999997 instead of %3www.2cto.com? I think about a cigarette on the computer, why? I have been studying java for two years. How can I answer this question suddenly? I have repeatedly thought out my ideas. Please discuss them together! 1. First, you must understand that the computer only recognizes 0 and 1. 2. in java, the floating point representation is represented according to the IEEE754 standard. Generally, the number (s) is 1 bit, and the order (E) is different depending on the floating point type, the ending number (M) is also different in the number of digits of different types, so the total length of the number of digits that a computer can represent is limited to 32-bit, 64-bit, 80-bit. 3. You must understand that when decimal points are converted to binary values, some decimal points cannot be fully converted and only approximate values can be taken. 4. for example, 0.35 is converted to binary 0. 01100 .......... if this binary code is converted into a decimal number, it cannot be expressed as 0.35. It can only be infinitely close to 0.35. this is the so-called loss of precision, because some decimal places cannot be converted to binary, and some decimal places are lost.