NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3662 most downloaded on crates.io
Fast decimal numbers library
Last release 3 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
One column per month.
Hashcode in Decimal violates the hash contract : #59 .
serde-arbitrary-precision feature to enable arbitrary precision serialization and deserialization for DecimalUnsignedDecimal types via arbitrary-precision feature of serde_json.bump MSRV to 1.88 and enable num-traits/libm #57 .
Sign Extension Not Performed in From<i32/i64>, Cast, and TryCast for Signed Integers #52 .
Incorrect division result for numbers with large amount of decimal digits #49 .
.ln() panic regression (0.2.10 -> 0.7.0) #46 .
Decimal::with_rounding_mode and Decimal::with_ctx:
INEXACT) and the new context enables traps for those signals; this may result in a panic depending onBig-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) -> Stringparse_str(s) and from_str(s) for big integers recognize 0x and 0b prefixes (decimal remains default without a prefix).bint/convert/{from_bytes,to_bytes,from_str,to_str}.rsMinor internal performance improvements.
Minor performance improvements.
Removed previously deprecated Decimal methods:
from_scale (use quantum instead).normalized (use reduce instead).with_scale (use rescale instead).Decimal::trunc() — truncates to integral with no fractional portion without rounding.Decimal::trunc_with_scale(scale) — truncates to the specified scale without rounding.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 trai…
Cast — type-safe, infallible conversion (e.g., widening or lossless transforms).TryCast — checked conversion returning an error on overflow, sign mismatch, or incompatible scale.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).Cast.TryCast, with overflow errors.TryCast rejects negative/out-of-range values.UD* and D* — proper sign/scale propagation with checks in TryCast.Widen/Narrow markers ensure Cast/TryCast correctness without unstable generic const expressions..transmute() is now deprecated (since "0.5.0"); removal is planned for a future major release..resize() or cast via Cast and TryCast traits instead.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Internal performance optimizations.
This release is mostly focused on fix: #34.
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:
Bump Rust version to 1.87 (stabilize [ #![feature(integer_sign_cast)]](https://github.com/rust-lang/rust/issues/125882)).
1.87 (stabilize
#![feature(integer_sign_cast)]).bnum type aliasing to wrapped types.Fix incorrect D64 to_f64 implementation: #29.
### Fixed - Fix inaccurate pow: #28.
Add impl From for Decimal convertion trait implementation.
impl From<UnsignedDecimal> for Decimal convertion trait implementation.Incorrect cmp implementation: #22.
The comparison function does not correctly implement a total order: #21.
Examples for compile time environment variables.
Add public constant functions for convert Decimal and UnsignedDecimal from/to Rust's primitive numeric types: #15.
Internal conversion to NBase fails for some numbers: #16.
Some float2decimal performance optimizations.
Incorrect .ceil() and floor() behavior for negative values.
.ceil() and floor() behavior for negative values.This release primarily focuses on:
This release primarily focuses on:
7 extra precision digits instead
of 4.Expect better performance, precision handling, and expanded documentation covering new methods and examples.
1.83
floor() and ceil() const methods.floor() and ceil() methods in num_traits Float implementation.Add tokio-postgres feature which enables serialization and deserialization of fastnum decimals for `tokio-postgres` crate #8.
tokio-postgres feature which enables serialization and deserialization of fastnum decimals for
tokio-postgres
crate #8.tokio-postgres and sqlx_postgres examples.Incorrect to_f64 impl on Decimal: #7.
### Fixed - Fixed compilation warnings
This release primarily focuses on:
This release primarily focuses on:
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.
exp and binary exponential exp2 functions for decimals.ln, log10, log2, log functions for decimals.sqrt, cbrt, and nth_root roots functions for decimals.pow to support non-integer exponents.sin, cos, tan, sin_cos for decimals.asin, acos, atan, atan2 for decimals.sinh, cosh, tanh for decimals.asinh, acosh, atanh for decimals.hypot function for decimals.mul_add operation without intermediate rounding.transmute operation for N-to-M bit decimal conversion.from_int, from_uint).num_traits::float::Float trait.INEXACT flag and extra precision digits.inexact by design.recip method without division.sqrt, ln, exp).libm dependency for no-std environment.f32/f64) from/to Decimal conversions
(fix #5).LIB.md.Replace decimal::Category with core::FpCategory.
decimal::Category with core::num::FpCategory..from_parts() constructor public (Way to directly create decimals with scale without dividing? #3).TryFrom<Decimal> for UnsignedDecimal and From<UnsignedDecimal> for Decimal traits.Fixed a performance issue with parsing and rescaling during arithmetic operations.
ilog10 method for integers with faster algorithm.x 10 multiplication with a faster algorithm (const static lookup table).Division by divisor with non-scalable coefficient.
#[repr] for Decimal type.num_traits::float::FloatCore trait.MIN_POSITIVE and EPSILON constants..powi(), .recip(), .to_degrees(), .to_radians() methods.Add basic mathematical constants (PI, E, etc.).
PI, E, etc.).num_traits::FloatConst trait.cargo test failing two tests on macOS #2
Deprecate and replace some outdated methods to align with the updated structure and functionality.
The main goals of this release are:
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. ### Fixed * sqlx support for PostgreSQL. ### Changed * Minor documentation fixes. * Remove const_str dependency.
sqlx support for PostgreSQL.const_str dependency.Deprecated with_scale! in favor of quantum!.
signals! macro.with_scale! in favor of quantum!.* Minor fixes.
Internal decimal representation for signed and unsigned decimal types.
64 bit to 16 bit.DecimalResult and unwrap methods.ArithmeticPolicy, OverflowPolicy, RoundingPolicy with Context.NaN and ±Infinity special values.Flags and Signal.Context and SignalingTraps.with_context! macro.Extend test coverage for numtraits feature.
numtraits feature.* Stabilize API
Nothing published for this version
Nothing published for this version
Nothing published for this version
* Stabilize API
* Bump utoipa to 5.0.x version
utoipa to 5.0.x version* Stabilize API * Improve docs
* Stabilize API
Nothing published for this version
Nothing published for this version
* Technical releases
Nothing published for this version
* Initial commit
Your coding agent can read these notes before it upgrades. Set up the MCP server →