该文档描述.Machine$double.eps为最小的正浮点数x1 + x != 1.所以我希望以下产生1:
options(digits=17)
1 + .Machine$double.eps
# [1] 1.0000000000000002
Run Code Online (Sandbox Code Playgroud)
但事实并非如此.似乎我必须尽可能低到0.5*.Machine$double.eps达到预期的四舍五入之前.我误解了一些事情.Machine$double.eps吗?这个平台依赖吗?(下面的sessionInfo())
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.0.2
Run Code Online (Sandbox Code Playgroud)
谢谢
r ×1