PackageTrack
Sign in Get early access

fastnum

Fast decimal numbers library

0.7.5 5.7M downloads/mo #4251 most downloaded on crates.io neogenie/fastnum

What this package is like to depend on

Last release 2 months ago

11 Jun 2026

Release timing varies

gaps range from 9 days to 6 months

Most releases are documented

notes for 44 of 51 stable releases

7 versions withdrawn

withdrawn after publishing

2 years old

58 releases · first in 2024

5 releases in the last 12 months

see the full history below

Release timeline

58 releases · Oct 2024 to Jun 2026
2025 2026
Release Pre-release Withdrawn

Releases

latest 58
  1. 0.7.5 11 Jun 2026
    Release notes

    Fixed

    • Hashcode in Decimal violates
      the hash contract: #59.
    • Add serde-arbitrary-precision feature to enable arbitrary precision serialization and deserialization for Decimal
      and UnsignedDecimal types via arbitrary-precision feature of serde_json.
    • bump MSRV to 1.94
    Open source →
  2. 0.7.4 16 Dec 2025
    Release notes

    Fixed

    • bump MSRV to 1.88 and enable num-traits/libm #57.
    Open source →
  3. 0.7.3 14 Oct 2025
    Release notes

    Fixed

    • Sign Extension Not Performed in From<i32/i64>, Cast, and TryCast for Signed Integers #52.

    Internal

    • Refactored integer conversion implementation for better code organization and maintainability.
    • Simplified signed integer conversion methods by removing redundant intermediate logic.
    • Improved macro handling for literal construction to properly support token concatenation.
    • Reorganized test infrastructure with macro-based test generation for comprehensive coverage of integer conversions across different bit widths (64/128/256/512).
    • Consolidated test structure by moving conversion tests into dedicated modules with automatic test generation for all supported integer types.
    Open source →
  4. 0.7.2 21 Sep 2025
    Release notes

    Fixed

    • Incorrect division result for numbers with large amount of decimal digits #49.
    • Fix no_std build #50.

    Changed

    • Improve debug formatting of Decimal and UnsignedDecimal.

    Examples

    • Add no_std wasm example #50.
    Open source →
  5. 0.7.1 30 Aug 2025
    Release notes

    Fixed

    • .ln() panic regression (0.2.10 -> 0.7.0) #46.

    Changed

    • Improve log implementation #38.

    Documentation

    • Documentation for Decimal::with_rounding_mode and Decimal::with_ctx:
      • Clarified that when changing the rounding mode, any existing extra precision (if present) is immediately rounded
        using the new rule.
      • Clarified that applying a new context may trigger traps if the current value already has signaling flags set (
        e.g., INEXACT) and the new context enables traps for those signals; this may result in a panic depending on
        build/configuration.
    • Minor fixes.
    Open source →
  6. 0.7.0 21 Aug 2025
    Release notes

    Added

    • Big-integer conversion APIs #44:
      • Parsing from raw bytes:

        • from_radix_be(buf, radix) -> Option<Self>
        • from_radix_le(buf, radix) -> Option<Self>
      • Encoding to raw bytes:

        • to_radix_be(radix) -> Vec<u8>
        • to_radix_le(radix) -> Vec<u8>
      • String conversion helpers:

        • parse_str_radix(s, radix) -> Self (panicking variant)
        • parse_bytes(buf, radix) -> Option<Self>
        • to_str_radix(radix) -> String

    Documentation

    • Conversion documentation expanded with clearer semantics, base handling, and examples.
    • Improved doc comments for:
      • Base-aware parsing behavior and panic conditions.
      • Byte-level import/export helpers.
      • parse_str(s) and from_str(s) for big integers recognize 0x and 0b prefixes (decimal remains default without a prefix).

    Internal

    • Conversion code reorganized into focused modules:
      • bint/convert/{from_bytes,to_bytes,from_str,to_str}.rs
    • Macro routing for conversion implementation is simplified and deduplicated.
    Open source →
  7. 0.6.2 17 Aug 2025
    Release notes

    Changed

    • Minor internal performance improvements.
    Open source →
  8. 0.6.1 16 Aug 2025
    Release notes

    Changed

    • Minor performance improvements.
    Open source →
  9. 0.6.0 15 Aug 2025
    Release notes

    Breaking changes

    • Removed previously deprecated Decimal methods:
      • from_scale (use quantum instead).
      • normalized (use reduce instead).
      • with_scale (use rescale instead).

    Added

    • Decimal truncation API (#39):
      • Decimal::trunc() — truncates to integral with no fractional portion without rounding.
      • Decimal::trunc_with_scale(scale) — truncates to the specified scale without rounding.

    Changed

    • Internal documentation macro routing for decimal type aliases refined (no public API impact).

    Documentation

    • Minor fixes.
    • Added a dedicated “Truncate” section with behavior details and examples.

    Internal

    • Introduced an internal truncation implementation integrated with scaling and extra-precision handling to ensure true
      truncation semantics (no rounding).
    Open source →
  10. 0.5.0 14 Aug 2025
    Release notes

    Added

    • Type conversion traits for integers and decimals:
      • Cast — type-safe, infallible conversion (e.g., widening or lossless transforms).
      • TryCast — checked conversion returning an error on overflow, sign mismatch, or incompatible scale.
      • Supported families: unsigned/signed big integers (U64, U128, U256, U512, U1024, and I64, I128,
        I256, I512, I1024) #42 and decimals (UD64, UD128, UD256, UD512, UD1024, and D64, D128, D256,
        D512, D1024).
      • Common scenarios:
        • Widening cast for integers — via Cast.
        • Checked narrowing cast — via TryCast, with overflow errors.
        • Conversions between unsigned and signed integers — TryCast rejects negative/out-of-range values.
        • Conversions between UD* and D* — proper sign/scale propagation with checks in TryCast.
    • Const-generic “dimensions” for conversion direction checks:
      • Internal Widen/Narrow markers ensure Cast/TryCast correctness without unstable generic const expressions.

    Deprecated

    • Decimal .transmute() is now deprecated (since "0.5.0"); removal is planned for a future major release.
      Use .resize() or cast via Cast and TryCast traits instead.

    Documentation

    • Minor fixes and clarifications; added usage examples for type conversions.
    Open source →
  11. 0.4.5 12 Aug 2025

    Nothing published for this version

  12. 0.4.4 12 Aug 2025

    Nothing published for this version

  13. 0.4.3 12 Aug 2025

    Nothing published for this version

  14. 0.4.2 11 Aug 2025 withdrawn

    Nothing published for this version

  15. 0.4.1 10 Aug 2025 withdrawn

    Nothing published for this version

  16. 0.4.0 10 Aug 2025 withdrawn

    Nothing published for this version

  17. 0.3.2 22 Jul 2025
    Release notes

    Changed

    • Internal performance optimizations.
    Open source →
  18. 0.3.1 20 Jul 2025
    Release notes

    Changed

    This release is mostly focused on fix: #34.

    Converting decimal numbers to floating point IEEE 754 was completely redesigned. Implementation is based on LLVM’s libc experience: https://llvm.org/devmtg/2022-11/slides/QuickTalk3-ApproximatingatScale-StringToFloat.pdf Algorithms:

    Documentation

    • Add decimal -> f64 conversion benchmarks.
    Open source →
  19. 0.3.0 15 Jul 2025
    Release notes

    Changed

    • Bump Rust version to 1.87 (stabilize #![feature(integer_sign_cast)]).
    • Replace big integer's implementation from bnum type aliasing to wrapped types.
    • Some minor performance optimizations.
    Open source →
  20. 0.2.10 04 Jun 2025
    Release notes

    Fixed

    • Fix incorrect D64 to_f64 implementation: #29.
    Open source →
  21. 0.2.9 02 Jun 2025
    Release notes

    Fixed

    • Fix inaccurate pow: #28.
    Open source →
  22. 0.2.8 17 May 2025
    Release notes

    Added

    • Add impl From<UnsignedDecimal> for Decimal convertion trait implementation.

    Fixed

    • Fix display rounding error: #24.
    Open source →
  23. 0.2.7 15 May 2025
    Release notes

    Fixed

    • Incorrect cmp implementation: #22.
    Open source →
  24. 0.2.6 13 May 2025
    Release notes

    Fixed

    • The comparison function does not correctly implement a total order: #21.
    Open source →
  25. 0.2.5 03 May 2025
    Release notes

    Added

    • Examples for compile time environment variables.

    Fixed

    • Failing to converge the Brent iterative method for calculating reciprocals (infinity loop): #20.
    Open source →
  26. 0.2.4 03 May 2025
    Release notes

    Added

    • Add public constant functions for convert Decimal and UnsignedDecimal from/to Rust's primitive numeric types: #15.
    • Introduce .transmute() operation for N-to-M bit unsigned decimal conversion: #18.
    Open source →
  27. 0.2.3 07 Apr 2025
    Release notes

    Fixed

    • Internal conversion to NBase fails for some numbers: #16.
    Open source →
  28. 0.2.2 22 Feb 2025
    Release notes

    Changed

    • Some float2decimal performance optimizations.

    Fixed

    • Minor fixes in float2decimal conversion.
    • Minor fixes with extra precision digits.
    Open source →
  29. 0.2.1 18 Feb 2025
    Release notes

    Fixed

    • Incorrect .ceil() and floor() behavior for negative values.
    Open source →
  30. 0.2.0 17 Feb 2025
    Release notes

    This release primarily focuses on:

    • Increasing the accuracy of approximated mathematical calculations due to the use of 7 extra precision digits instead of 4.
    • Performance optimizations.

    Expect better performance, precision handling, and expanded documentation covering new methods and examples.

    Added

    • floor() and ceil() const methods.
    • Add basic tests for trivial trigonometric functions for 0–360 degree angles.

    Changed

    • Control block is completely refactored for better performance and more compact memory layout.
    • Micro-optimizations in rounding.
    • Inline optimizations and better precision handling for mathematical rounding.
    • Remove custom const float helpers as they're stabilized as const in rust 1.83.

    Fixed

    • Incorrect floor() and ceil() methods in num_traits Float implementation.

    Documentation

    • Minor fixes.
    Open source →
  31. 0.1.13 07 Feb 2025
    Release notes

    Added

    • Add tokio-postgres feature which enables serialization and deserialization of fastnum decimals for tokio-postgres crate #8.
    • Add tokio-postgres and sqlx_postgres examples.

    Documentation

    • Minor fixes.
    Open source →
  32. 0.1.12 06 Feb 2025
    Release notes

    Fixed

    • Incorrect to_f64 impl on Decimal: #7.

    Documentation

    • Minor fixes.
    Open source →
  33. 0.1.11 04 Feb 2025
    Release notes

    Fixed

    • Fixed compilation warnings
    Open source →
  34. 0.1.10 04 Feb 2025
    Release notes

    This release primarily focuses on:

    • Implementing a full range of advanced mathematical functions (exponential, roots, power, logarithmic, and trigonometric functions) for working with exact precision decimal numbers.
    • Increasing the accuracy of approximated mathematical calculations due to the use of extra precision digits and the absence of intermediate rounding.
    • Fixing and improving conversions between Float and Decimal types.

    Expect better performance, precision handling, and expanded documentation covering new methods, constants, and examples. Highlights include removing libm dependency and major refinements for no-std environments.

    Added

    • Implement exponential exp and binary exponential exp2 functions for decimals.
    • Implement logarithmic ln, log10, log2, log functions for decimals.
    • Implement sqrt, cbrt, and nth_root roots functions for decimals.
    • Refactor and extend pow to support non-integer exponents.
    • Implement base trigonometric functions: sin, cos, tan, sin_cos for decimals.
    • Implement inverse trigonometric functions: asin, acos, atan, atan2 for decimals.
    • Implement hyperbolic functions: sinh, cosh, tanh for decimals.
    • Implement inverse hyperbolic functions: asinh, acosh, atanh for decimals.
    • Implement hypotenuse calculation hypot function for decimals.
    • Introduce fused multiply-add mul_add operation without intermediate rounding.
    • Introduce transmute operation for N-to-M bit decimal conversion.
    • Add integer and unsigned integer conversion utilities (from_int, from_uint).
    • Implement num_traits::float::Float trait.

    Changed

    • Improved arithmetic precision of approximated mathematical calculations due to the use of extra precision digits and the absence of intermediate rounding.
    • Overhauled mathematical constants. Add INEXACT flag and extra precision digits.
    • Mark some methods as inexact by design.
    • Micro-optimizations in rounding.
    • Inline optimizations and better precision handling for mathematical rounding.
    • Re-implement recip method without division.
    • Improve test coverage for mathematical operations (e.g., sqrt, ln, exp).
    • Remove libm dependency for no-std environment.

    Fixed

    • Corrected edge cases for float (f32/f64) from/to Decimal conversions (fix #5).
    • Fix long rounding issues with improved context precision.
    • General code quality improvements and bug fixes, including better inexact flag handling.

    Documentation

    • Expanded documentation for all major operations with examples.
    • Added comprehensive examples and descriptions to LIB.md.
    • Minor fixes.
    Open source →
  35. 0.1.9 01 Jan 2025
    Release notes

    Breaking changes

    • Replace decimal::Category with core::num::FpCategory.

    Changed

    • Micro-optimizations in rounding.
    • Make .from_parts() constructor public (Way to directly create decimals with scale without dividing? #3).

    Added

    • Implement TryFrom<Decimal> for UnsignedDecimal and From<UnsignedDecimal> for Decimal traits.

    Fixed

    • Fixed minor issues with ceil/floor rounding.
    Open source →
  36. 0.1.8 29 Dec 2024
    Release notes

    Fixed

    • Fixed a performance issue with parsing and rescaling during arithmetic operations.

    Changed

    • Replace ilog10 method for integers with faster algorithm.
    • Replace x 10 multiplication with a faster algorithm (const static lookup table).
    • Some performance improvements.
    Open source →
  37. 0.1.7 25 Dec 2024
    Release notes

    Fixed

    • Division by divisor with non-scalable coefficient.

    Changed

    • More strict #[repr] for Decimal type.
    • Documentation improvements.

    Added

    • Implement num_traits::float::FloatCore trait.
    • Add MIN_POSITIVE and EPSILON constants.
    • Add .powi(), .recip(), .to_degrees(), .to_radians() methods.
    Open source →
  38. 0.1.6 24 Dec 2024
    Release notes

    Changed

    • Documentation improvements.

    Added

    • Add basic mathematical constants (PI, E, etc.).
    • Implement num_traits::FloatConst trait.
    Open source →
  39. 0.1.5 22 Dec 2024
    Release notes

    Fixed

    • cargo test failing two tests on macOS #2
    Open source →
  40. 0.1.4 22 Dec 2024
    Release notes

    The main goals of this release are:

    • Stabilize API for more stringent compliance with the recommendations of IEEE 754 and IEEE 854 standards.
    • Refactor decimal module and simplify context usage.

    Breaking changes

    • Remove [Context] from a most methods argument list and put it into decimal control block for better context handling. Now [Context] is a property of any Decimal number instance.

    Added

    • Extend test coverage.

    Changed

    • Documentation improvements.
    • Deprecate and replace some outdated methods to align with the updated structure and functionality.
    • Benchmarks were modularized into separate operations, enhancing clarity and maintainability.
    Open source →
  41. 0.1.3 16 Dec 2024
    Release notes

    Added

    • Extend test coverage.

    Fixed

    • sqlx support for PostgreSQL.

    Changed

    • Minor documentation fixes.
    • Remove const_str dependency.
    Open source →
  42. 0.1.2 15 Dec 2024
    Release notes

    Added

    • Added signals! macro.
    • Extend test coverage.

    Changed

    • Deprecated with_scale! in favor of quantum!.
    • Documentation improvements.
    Open source →
  43. 0.1.1 11 Dec 2024
    Release notes
    • Minor fixes.
    Open source →
  44. 0.1.0 11 Dec 2024
    Release notes

    Breaking changes

    • Internal decimal representation for signed and unsigned decimal types.
    • Reduce exponent from 64 bit to 16 bit.
    • Remove DecimalResult and unwrap methods.
    • Replace ArithmeticPolicy, OverflowPolicy, RoundingPolicy with Context.

    Added

    • Add NaN and ±Infinity special values.
    • Add Flags and Signal.
    • Add Context and SignalingTraps.
    • Add with_context! macro.

    Fixed

    • Fix panic shift with overflow.

    Changed

    • Stabilize API.
    • Re-implement most methods.
    • Documentation improvements.
    Open source →
  45. 0.0.14 27 Nov 2024
    Release notes
    • Fix rounding subtraction.
    • Extend test coverage for numtraits feature.
    • Documentation improvements.
    Open source →
  46. 0.0.13 24 Nov 2024
    Release notes
    • Stabilize API
    Open source →
  47. 0.0.12 22 Nov 2024

    Nothing published for this version

  48. 0.0.11 21 Nov 2024

    Nothing published for this version

  49. 0.0.10 21 Nov 2024

    Nothing published for this version

  50. 0.0.9 21 Nov 2024
    Release notes
    • Stabilize API
    Open source →
  51. 0.0.8 19 Nov 2024
    Release notes
    • Bump utoipa to 5.0.x version
    Open source →
  52. 0.0.7 19 Nov 2024
    Release notes
    • Stabilize API
    • Improve docs
    Open source →
  53. 0.0.6 19 Nov 2024
    Release notes
    • Stabilize API
    Open source →
  54. 0.0.5 06 Nov 2024

    Nothing published for this version

  55. 0.0.4 06 Nov 2024 withdrawn

    Nothing published for this version

  56. 0.0.3 05 Nov 2024 withdrawn

    Nothing published for this version

  57. 0.0.2 25 Oct 2024 withdrawn

    Nothing published for this version

  58. 0.0.1 21 Oct 2024 withdrawn
    Release notes
    • Initial commit
    Open source →

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