Reducing Precision in Doubles in R

前端 未结 3 2025
广开言路
广开言路 2021-01-14 05:28

I\'m looking for a way to consistently ignore small differences between floating point numbers in R (these are double precision floating points as per IEC 60559), by using b

3条回答
  •  春和景丽
    2021-01-14 06:32

    One possible solution is to use signif, a function related to round and included in the same help file. The help file from ?signif, says

    signif rounds the values in its first argument to the specified number of significant digits.

    Whereas

    round rounds the values in its first argument to the specified number of decimal places (default 0).

    So it appears that signif may be more closely related to your problem.

提交回复
热议问题