Struct com_croftsoft_core::math::finance_lib::FutureValue
source · [−]Expand description
Calculates the future value of a cash flow received today
Example
use com_croftsoft_core::math::finance_lib::FutureValue;
assert_eq!(
FutureValue {
cash_flow: 1.0, // Investing $1 today
interest_rate: 0.12, // At 12% per year
time_periods: 6.0, // For six years with interest compounded annually
}.calculate(),
1.973_822_685_184_001); // Will double your money (see the "Rule of 72")
Fields
cash_flow: f64
Cash flow invested or received today
interest_rate: f64
Interest, discount, or inflation rate (use 0.01 for 1%)
time_periods: f64
Number of periods from today when the value is evaluated
Implementations
sourceimpl FutureValue
impl FutureValue
Trait Implementations
sourceimpl Clone for FutureValue
impl Clone for FutureValue
sourcefn clone(&self) -> FutureValue
fn clone(&self) -> FutureValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for FutureValue
impl Debug for FutureValue
impl Copy for FutureValue
Auto Trait Implementations
impl RefUnwindSafe for FutureValue
impl Send for FutureValue
impl Sync for FutureValue
impl Unpin for FutureValue
impl UnwindSafe for FutureValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more