Display exact value of a variable in R

后端 未结 2 522
南笙
南笙 2020-11-29 13:33
> x <- 1.00042589212565
> x
[1] 1.000426

If I wanted to print the exact value of x, how would I do it?

Sorry if this

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 13:54

    print(x, digits=15)
    

    or

    format(x, digits=15)
    

    or

    sprintf("%.14f", x)
    

提交回复
热议问题