We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using rust_decimal to implement a Monte Carlo simulation that requires the use of the exponential function (e^x).
rust_decimal
While debugging values in the Monte Carlo, I ran into a case where the input to Decimal::exp() was -1, and the output was zero.
Decimal::exp()
-1
zero
Simplified code:
use rust_decimal::prelude::*; fn main() { let decimal = Decimal::from_str("-1").unwrap(); let value = decimal.exp(); println!("Value: {:?}", value); // Value: 0 }
Wolfram alpha: 0.36787944117 https://www.wolframalpha.com/input/?i=e%5E-1
0.36787944117
Any ideas on what might be causing the approximation to be incorrect?
The text was updated successfully, but these errors were encountered:
paupino
Successfully merging a pull request may close this issue.
I'm using
rust_decimal
to implement a Monte Carlo simulation that requires the use of the exponential function (e^x).While debugging values in the Monte Carlo, I ran into a case where the input to
Decimal::exp()
was-1
, and the output waszero
.Simplified code:
Wolfram alpha:
0.36787944117
https://www.wolframalpha.com/input/?i=e%5E-1
Any ideas on what might be causing the approximation to be incorrect?
The text was updated successfully, but these errors were encountered: