pub struct PresentValuePaymentStream {
pub cash_flow: f64,
pub inflation_rate: f64,
pub time_periods: f64,
}
Expand description
Calculates the present value of a payment stream such as an annuity
Example
use com_croftsoft_core::math::finance_lib::PresentValuePaymentStream;
assert_eq!(
PresentValuePaymentStream {
cash_flow : 1.0, // A dollar every year starting a year from today
inflation_rate: 0.10, // With inflation at 10% per year
time_periods: 10.0, // For ten years
}.calculate(),
6.144567105704685); // Is the same as receiving ~$6.14 today
Fields
cash_flow: f64
inflation_rate: f64
The inflation rate or interest rate per time period (use 0.01 for 1%)
time_periods: f64
Number of time periods of cash income
Implementations
Trait Implementations
sourceimpl Clone for PresentValuePaymentStream
impl Clone for PresentValuePaymentStream
sourcefn clone(&self) -> PresentValuePaymentStream
fn clone(&self) -> PresentValuePaymentStream
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 PresentValuePaymentStream
impl Debug for PresentValuePaymentStream
impl Copy for PresentValuePaymentStream
Auto Trait Implementations
impl RefUnwindSafe for PresentValuePaymentStream
impl Send for PresentValuePaymentStream
impl Sync for PresentValuePaymentStream
impl Unpin for PresentValuePaymentStream
impl UnwindSafe for PresentValuePaymentStream
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