paupino / rust-decimal

Decimal number implementation written in pure Rust suitable for financial and fixed-precision calculations.
https://docs.rs/rust_decimal/
MIT License
1.03k stars 183 forks source link

Fixes issue with is_integer failing on decimal bounds #605

Closed paupino closed 1 year ago

paupino commented 1 year ago

This fixes #604

An issue was found where by precise integers >= scale 10 were being scaled back too aggressively causing numbers at an integer bound for the mantissa to be rounded toward the integer itself. It was effectively "skipping" a power of 10 during comparison - which when the mantissa was a power of 10 itself, would cause inaccurate results.