我不理解,帮助也没有说出取决于数字的回合:
a <- 22.899999999999999
# [1] 22.899999999999999
options(digits = 20)
round(a, 1)
# [1] 22.899999999999999
options(digits = 7)
round(a, 1)
# [1] 22.9
options(digits = 20)
round(a, 1)
# [1] 22.899999999999999
答案 0 :(得分:2)
不是,round
只是返回您的原始号码。
identical(a,round(a,1))
[1] TRUE
在digits
中更改options
会影响显示这些数字的方式。