pub struct FutureValuePaymentStream {
    pub cash_income: f64,
    pub interest_rate: f64,
    pub time_periods: f64,
}
Expand description

Calculates the future value of a payment stream such as an annuity

Example

use com_croftsoft_core::math::finance_lib::FutureValuePaymentStream;
assert_eq!(
  FutureValuePaymentStream {
    cash_income:   10_000.0, // Future payments of $10k per year
    interest_rate: 0.10,     // With 10% interest annually on the payments
    time_periods:  10.0,     // Paying each year for ten years
  }.calculate(),
  159_374.246_010_000_2);    // Will be worth ~$159k in the future

Fields

cash_income: f64

Periodic cash income payment starting one period from today

interest_rate: f64

Periodic interest earned on income (use 0.01 for 1%)

time_periods: f64

Number of periods of cash income

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.