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 182 forks source link

bug: `abs_sub` does not compute the difference #665

Closed heyterrance closed 3 months ago

heyterrance commented 3 months ago

When self > other, self.abs() is returned instead of self - other

https://github.com/paupino/rust-decimal/blob/6f8b0ae8570b33727a779da8bb81983c4bb58d68/src/decimal.rs#L1895-L1901

paupino commented 3 months ago

This is a good catch - fortunately an easy fix will whip up a quick PR.