paupino / rust-decimal

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

Reimplement pow function for integer exponent. #638

Closed schungx closed 7 months ago

schungx commented 7 months ago

Fixes #631 and does not become pathological with larger exponents.

schungx commented 7 months ago

For some reason, one of the tests come up with an off-by-one error at the last decimal place.

I'm not sure why but it does not show up on my computer, which passes all tests.

It could be due to the beta version being used for tests...

paupino commented 7 months ago

It looks like it was failing when combined with the legacy-ops feature. At some stage I'll look at completing the deprecation and removing the feature (it's at least 4 years old past deprecation date). Anyway - I've gone ahead and removed the test for this feature for now.

Thank you for the PR!