Skip to content

Commit

Permalink
Added information about maths-nopanic
Browse files Browse the repository at this point in the history
  • Loading branch information
paupino committed Jul 28, 2021
1 parent 3a1dce3 commit 4e03adc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ To maintain backwards compatibility this can be opted out of by enabling the `le

The `maths` feature enables additional complex mathematical functions such as `pow`, `ln`, `enf`, `exp` etc.
Documentation detailing the additional functions can be found on the
[`MathematicalOps`](https://docs.rs/rust_decimal/latest/rust_decimal/trait.MathematicalOps.html) trait.
[`MathematicalOps`](https://docs.rs/rust_decimal/latest/rust_decimal/trait.MathematicalOps.html) trait.

Please note that `ln` and `log10` will panic on invalid input with `checked_ln` and `checked_log10` the preferred functions
to curb against this. When the `maths` feature was first developed the library would return `0` on invalid input. To re-enable this
non-panicing behavior, please use the feature: `maths-nopanic`.

### `rust-fuzz`

Expand Down
4 changes: 3 additions & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ A minor bug and feature release which adds a couple of new functions as well as
* Support for serializing to float without converting to float via the `serde-arbitrary-precision` feature.
[#402](https://github.com/paupino/rust-decimal/issues/402). Thanks [@JamesHinshelwood](https://github.com/JamesHinshelwood)!
for finding and fixing this!
* Add `log10` support to the `maths` feature. [#397](https://github.com/paupino/rust-decimal/issues/397).
* Add `log10` support to the `maths` feature. Please note that `ln` and `log10` will now panic on invalid input since both
functions have a `checked_*` equivalent. This is the preferred approach going forward, however if you would like to re-enable
the previous behavior please use the `maths-nopanic` feature. [#397](https://github.com/paupino/rust-decimal/issues/397).
* Added further constants to the `Decimal` library including `TWO`, `TEN`, `ONE_HUNDRED`, `ONE_THOUSAND`, and `NEGATIVE_ONE`.
[#400](https://github.com/paupino/rust-decimal/issues/400).
* Fixes serialization issue for `-0` whereby `-` would be output [#406](https://github.com/paupino/rust-decimal/pull/406). Thanks
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
//! Documentation detailing the additional functions can be found on the
//! [`MathematicalOps`](https://docs.rs/rust_decimal/latest/rust_decimal/trait.MathematicalOps.html) trait.
//!
//! Please note that `ln` and `log10` will panic on invalid input with `checked_ln` and `checked_log10` the preferred functions
//! to curb against this. When the `maths` feature was first developed the library would return `0` on invalid input. To re-enable this
//! non-panicing behavior, please use the feature: `maths-nopanic`.
//!
//! ### `rust-fuzz`
//!
//! Enable `rust-fuzz` support by implementing the `Arbitrary` trait.
Expand Down

0 comments on commit 4e03adc

Please sign in to comment.