Rounding to Decimal Digits

Decimal rounding is non-trivial in binary arithmetic. ISO standard round to even is more rare than typically assumed as most decimal fractions are not exactly representable in binary. Our 'roundX()' versions explore differences between current and potential future versions of round() in R. Further, provides (some partly related) C99 math lib functions not in base R.


round

Versions of round(x, digits) for R. This is less trivial than you may think: Numbers (and arithmetic) is in binary, rounding (apart from digits=0) is to decimals.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("round")

0.21-0.2 by Martin Maechler, 3 years ago


https://gitlab.com/mmaechler/round/


Report a bug at https://gitlab.com/mmaechler/round/-/issues


Browse source code at https://github.com/cran/round


Authors: Martin Maechler [aut, cre] , R-core [ctb] ("r1.C" only)


Documentation:   PDF Manual  


AGPL (>= 3) | file LICENSE license


Imports stats

Suggests grDevices, graphics, Matrix, lattice, gmp, knitr, rmarkdown


Suggested by gmp.


See at CRAN