import "github.com/cinar/indicator/v2/valuation"- func Fv(pv, rate float64, years int) float64
- func Npv(rate float64, cfs []float64) float64
- func Pv(fv, rate float64, years int) float64
func Fv
func Fv(pv, rate float64, years int) float64Fv calculates the Future Value (FV) of a Present Value (PV).
Formula: FV = PV * (1 + rate)^years
func Npv
func Npv(rate float64, cfs []float64) float64Npv calculates the Net Present Value (NPV) of a series of cash flows.
Formula: NPV = sum(CF_i / (1 + rate)^i) for i = 1 to n
func Pv
func Pv(fv, rate float64, years int) float64Pv calculates the Present Value (PV) of a Future Value (FV).
Formula: PV = FV / (1 + rate)^years
Generated by gomarkdoc