PackageTrack
Sign in Get early access

bigdecimal

Arbitrary precision decimal numbers

0.4.10 110M downloads/mo #759 most downloaded on crates.io akubera/bigdecimal-rs

What this package is like to depend on

Last release 7 months ago

27 Dec 2025

Release timing varies

gaps range from 6 weeks to 1.7 years

Some releases are documented

notes for 10 of 25 stable releases

1 version withdrawn

withdrawn after publishing

9 years old

26 releases · first in 2017

2 releases in the last 12 months

see the full history below

Release timeline

26 releases · Apr 2017 to Dec 2025
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 26
  1. 0.4.10 27 Dec 2025
    Release notes

    Changes

    • Add comparison operators between BigDecimal and primitive integers
    • Improve accuracy of initial iteration in square-root calculation
    • Only include necessary Rust files in the released package (no extra dev-scripts when downloading)
    Open source →
  2. 0.4.9 19 Oct 2025
    Release notes

    Changes

    • Add methods BigDecimal::{powi, powi_with_context} for raising a decimal to a i64 power

      • the powi uses Default Context
    • Add methods BigDecimal::mul_with_context for efficient multiplication to fixed precision

      • uses precision and rounding-mode in the Context
    • Add method BigDecimal::decimal_digit_count, returning number of decimal digits (i.e. precision) of the number

    • Add method BigDecimal::order_of_magnitude, returning position of most significant digit of this decimal

    • Add method BigDecimal::is_one_quickcheck, returning Option<bool> indicating if the value is 1.0 if it can be calculated without allocating, or None if too large

      • Replaced is_one in multiplication methods when used for optimizations
        • Should test if that actually speeds it up
      • Eg value 1.00000000000000000000000000000000000000000 is stored internally as
        [4870020673419870208, 16114848830623546549, 293] E -41 and it's hard to tell this is equivalent to 1
    • Add optimizations to inverse

      • small powers of ten will simply flip their scale 1/10e-5 -> 10e5
      • convert to f64 to make initial guess when before iterative algorithm
    • Add Context::invert(&self, BigDecimalRef), equivalent to BigDecimal::inverse_with_context(&self, &ctx)

      • Still has a bug where rounding ignores sign, affecting floor/ceiling modes
    Open source →
  3. 0.4.8 01 Apr 2025
    Release notes

    What's Changed

    Full Changelog: v0.4.7...v0.4.8

    Open source →
  4. 0.4.7 08 Dec 2024
    Release notes

    Changes

    • Fixed bug in BigDecimal::to_f64
    • Impl num_traits::ToPrimitive for BigDecimalRef
    • Added methods BigDecimal::{ToPlainString,WritePlainString}
    • Added Justfile to repo
    Open source →
  5. 0.4.6 28 Oct 2024
    Release notes

    Changes

    • Fix error in formatting code that would skip "carrying the one" when rounding up series of nines, overflowing

    • Improved implementation of sqrt and cbrt

    • Uses consistent rounding implementations in formatting and arithmetic operations

    • Add new constructor methods BigDecimal::from_bigint & BigDecimal::from_biguint

    Open source →
  6. 0.4.5 17 Jun 2024
    Release notes

    Changes

    • Remove restrictions on num-* dependencies.

      • num-traits and num-bigint need to be specified for users using Rust versions older than 1.60 (let me know if this should be continued to be supported)
    • Fix some bad assumptions when running in 32 bit mode.

      • Uses of as usize have been replaced with as u64
    Open source →
  7. 0.4.4 15 Jun 2024
    Release notes

    Changes

    • Revert formatting semantics to match Rust's meanings rather than Python's
      • The meaning of the formatting string "{:.4}" has returned to "4 digits after decimal place" rather than "four digits of precision"
    • Add new compile-time parameters for safer formatting
      • Configurable thresholds prevent printing out full decimal form of large numbers, like 1e999999999999999 (could be used in)
    • Improved JSON serialization / formatting routines

    Note

    Please add your own tests to ensure this library formats (and continues to format) numbers as you expect

    • Added methods

      • BigDecimalRef::clone_into
      • BigDecimal::set_scale (mutable version of take_and_scale)
    • Optimized bigdecimal comparison algorithms

    • Restricted versions of num-* crates to respect Minimum Supported Rust Version (1.43)

      • I may raise this up soon
    Open source →
  8. 0.4.3 05 Mar 2024
    Release notes

    Changes

    • Use exponential formatting (scientific-notation) if number of leading zeros is greater than 5
      • so 1234e-304 is formatted as 1.234e-301 rather than 0.00.....(300-zeros)....00123
      • Fixes "out of memory errors" when massive amounts of zeros would have been printed
    • Add methods for printing using scientific-notation & engineering-notation
    • Add derived Clone trait to ParseBigDecimalError
    • Preserve scale when adding zero
      • Mimics Python's Decimal behavior:
        >>> Decimal("1.2") + Decimal("0.00000")
        Decimal('1.20000')
    • Minor optimizations removing unnecessary clones in addition and multiplication
    Open source →
  9. 0.4.2 16 Oct 2023
    Release notes

    Changes

    • Add Context struct

      • For user-controlled precision and rounding
      • Support for a few BigDecimal functions added (eg: sqrt_with_context(&self, ctx: &Context)) , more to come in future versions.
      • Note standard operations use default (compile-time-defined) context
    • Add BigDecimalRef struct

      • Non-owning BigDecimal struct that has some non-digit-changing methods (i.e. change sign/scale without copying digits) for more efficient calculations
      • Implements math operations Add,Sub
      • Implement From<&BigInt> for BigDecimalRef
    • Compile-time default rounding mode may be set by environment variable RUST_BIGDECIMAL_DEFAULT_ROUNDING_MODE

    • Fix issue recompiling if RUST_BIGDECIMAL_DEFAULT_PRECISION haddn't changed

    • Add BigDecimal::with_precision_round()

      • trim the bigdecimal after operations, rounding at given point
    • Add BigDecimal::fractional_digit_count()

      • Return's the bigdecimal's "scale", (number of digits right of the decimal point)
    • Support reading subnormal floating-point numbers

    • Improve initial "guess" in calculation of inverted value.

    • Fix panic in from_str_radix (#115)

    • (internal) Reorganize std::ops implementations by moving each to separate functions (src/impl_ops_add.rs, src/impl_ops_sub.rs, etc)

    Performance Improvements

    • BigDecimal::eq takes into account trailing zeros, avoids aligning digits
    • (internal) ten_to_the - used everywhere to align BigIntegers within BigDecimals, all operations with high precision numbers should be faster
    Open source →
  10. 0.4.1 13 Jul 2023
    Release notes

    Changes

    • Fix issue where RUST_BIGDECIMAL_DEFAULT_PRECISION envar would always
      trigger a rebuild

    • Fix issue where .neg() could be called on {signed-int}::MIN values

    • Add implementations of Add/Sub/Mul/Div for primitive values

    • Use 'proptest' crate to improve arithmetic testing

    Open source →
  11. 0.4.0 05 Jul 2023

    Nothing published for this version

  12. 0.3.1 09 May 2023

    Nothing published for this version

  13. 0.3.0 26 Aug 2021

    Nothing published for this version

  14. 0.2.2 26 Aug 2021

    Nothing published for this version

  15. 0.2.1 26 Aug 2021 withdrawn

    Nothing published for this version

  16. 0.2.0 02 Sep 2020

    Nothing published for this version

  17. 0.1.2 27 Apr 2020

    Nothing published for this version

  18. 0.1.0 12 Apr 2019

    Nothing published for this version

  19. 0.0.15 09 Feb 2019

    Nothing published for this version

  20. 0.0.14 30 Jul 2018

    Nothing published for this version

  21. 0.0.13 26 Jul 2018

    Nothing published for this version

  22. 0.0.12 27 May 2018

    Nothing published for this version

  23. 0.0.11 30 Mar 2018

    Nothing published for this version

  24. 0.0.10 02 Aug 2017

    Nothing published for this version

  25. 0.0.7 02 May 2017

    Nothing published for this version

  26. 0.0.1 05 Apr 2017

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive