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§
Source§impl Clone for PresentValuePaymentStream
impl Clone for PresentValuePaymentStream
Source§fn clone(&self) -> PresentValuePaymentStream
fn clone(&self) -> PresentValuePaymentStream
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PresentValuePaymentStream
impl Debug for PresentValuePaymentStream
impl Copy for PresentValuePaymentStream
Auto Trait Implementations§
impl Freeze for PresentValuePaymentStream
impl RefUnwindSafe for PresentValuePaymentStream
impl Send for PresentValuePaymentStream
impl Sync for PresentValuePaymentStream
impl Unpin for PresentValuePaymentStream
impl UnwindSafe for PresentValuePaymentStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more