cflow_pv.cc

来自「Financial Recipes」· CC 代码 · 共 13 行

CC
13
字号
#include <cmath>#include <vector>using namespace std;double cash_flow_pv( const vector<double>& cflow_times, 		     const vector<double>& cflow_amounts, double r){    double PV=0.0;    for (int t=0; t<cflow_times.size();t++) {	PV += cflow_amounts[t] * exp(-r*cflow_times[t]);    };    return PV;};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?