decimal: Exact Arbitrary-Precision Decimal Vectors

Arbitrary-precision vectors with an exact decimal representation, avoiding the rounding surprises of binary floating point. Built on the 'mpdecimal' C library, arithmetic is governed by an explicit decimal context controlling precision, rounding, and signaling, and vectors integrate with 'vctrs' for use in data frames, 'tibble' objects, summaries, and common numeric workflows. Missing values, signed zeros, infinities, and not-a-number values are supported throughout. The arithmetic model follows Cowlishaw (2009) "General Decimal Arithmetic" <https://speleotrove.com/decimal/decarith.html>.

Version: 0.1.1
Depends: R (≥ 4.2.0)
Imports: methods, rlang, vctrs, withr
Suggests: arrow, covr, data.table, dplyr, knitr, pillar, R6, rmarkdown, tibble, testthat (≥ 3.0.0)
Published: 2026-09-23
DOI: 10.32614/CRAN.package.decimal
Author: Pedro Baltazar [aut, cre, cph], Stefan Krah [ctb, cph] (Vendored 'mpdecimal' library in src/mpdecimal; see inst/COPYRIGHTS.)
Maintainer: Pedro Baltazar <pedrobtz at gmail.com>
BugReports: https://github.com/pedrobtz/decimal/issues
License: MIT + file LICENSE
Copyright: see file COPYRIGHTS
URL: https://github.com/pedrobtz/decimal, https://pedrobtz.github.io/decimal/
NeedsCompilation: yes
Language: en-US
Materials: README, NEWS
CRAN checks: decimal results

Documentation:

Reference manual: decimal.html , decimal.pdf
Vignettes: Arrow Decimal Types (source, R code)
Contexts and Signals (source, R code)
Decimal Values (source, R code)

Downloads:

Package source: decimal_0.1.1.tar.gz
Windows binaries: r-devel: decimal_0.1.0.zip, r-release: decimal_0.1.0.zip, r-oldrel: decimal_0.1.0.zip
macOS binaries: r-release (arm64): decimal_0.1.0.tgz, r-oldrel (arm64): decimal_0.1.0.tgz, r-release (x86_64): decimal_0.1.0.tgz, r-oldrel (x86_64): decimal_0.1.0.tgz
Old sources: decimal archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=decimal to link to this page.