要复制:
> 1 - 0.9 - 0.1
[1] -2.775558e-17
> 1 - 0.1 - 0.9
[1] 0
> 1 + (-0.9 -0.1)
[1] 0
> 1 + -0.9 + -0.1
[1] -2.775558e-17
> 1 + (-0.9 + -0.1)
[1] 0
> - 0.9 - 0.1 + 1
[1] 0
> - 0.9 + 1 - 0.1
[1] -2.775558e-17
> - 0.9 + (1 - 0.1)
[1] 0
有人可以解释这种行为吗?
添加。信息:
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)