When the code is compiled or interpreted, your "0.1" is already rounded to the nearest number in that format, which results in a small rounding error even before the calculation happens.
当代码被编译或者解释运行时,“0.1”已经被近似转化为这种形式下最接近的一个浮点数,这导致在计算还没有真正开始之前,一个微小的舍入误差就已经存在了。
When the code is compiled or interpreted, your "0.1" is already rounded to the nearest number in that format, which results in a small rounding error even before the calculation happens.
当代码被编译或者解释运行时,“0.1”已经被近似转化为这种形式下最接近的一个浮点数,这导致在计算还没有真正开始之前,一个微小的舍入误差就已经存在了。
应用推荐