设,x是一个整数和y = x * x.
x
y = x * x
那保证sqrt(y) == x吗?
sqrt(y) == x
例如,我可以确定sqrt(25)或sqrt(25.0)将返回5.0,不是5.0000000003或4.999999998?
sqrt(25)
sqrt(25.0)
5.0
5.0000000003
4.999999998
c++ floating-point-precision
c++ ×1
floating-point-precision ×1