public final class FinanceLib
extends java.lang.Object
p(1+r)^n + y(1+rt)((1+r)^n-1)/r + f=0 ...{when r!=0} ny + p + f=0 ...{when r=0}
Modifier and Type | Method and Description |
---|---|
static double |
fv(double r, double n, double y, double p, boolean t)
Future value of an amount given the number of payments, rate, amount of individual payment, present value and boolean value indicating whether payments are due at the beginning of period (false => payments are due at end of period)
(给定付款次数、费率、个人付款金额、现值和布尔值的金额的终值,指示付款是否在期初到期(错误 => 付款在期末到期))
|
static double |
nper(double r, double y, double p, double f, boolean t) |
static double |
npv(double r, double[] cfs)
calculates the Net Present Value of a principal amount given the discount rate and a sequence of cash flows (supplied as an array).
(在给定贴现率和现金流序列(以数组形式提供)的情况下计算本金的净现值。)
|
static double |
pmt(double r, double n, double p, double f, boolean t) |
static double |
pv(double r, double n, double y, double f, boolean t)
Present value of an amount given the number of future payments, rate, amount of individual payment, future value and boolean value indicating whether payments are due at the beginning of period (false => payments are due at end of period)
(给定未来付款次数、费率、个人付款金额、未来值和布尔值的金额的现值,指示付款是否在期初到期(错误 => 付款在期末到期))
|
public static double fv(double r, double n, double y, double p, boolean t)
r
- rate
(r - 比率)
n
- num of periods
(n - 周期数)
y
- pmt per period
(y - 每期 pmt)
p
- present value
(p - 现值)
t
- type (true=pmt at beginning of period, false=pmt at end of period)
(t - 类型(true=pmt 在期初,false=pmt 在期末))
public static double pv(double r, double n, double y, double f, boolean t)
r
- rate
(r - 比率)
n
- num of periods
(n - 周期数)
y
- pmt per period
(y - 每期 pmt)
f
- future value
(f - 未来价值)
t
- type (true=pmt at beginning of period, false=pmt at end of period)
(t - 类型(true=pmt 在期初,false=pmt 在期末))
public static double npv(double r, double[] cfs)
r
- rate
(r - 比率)
cfs
- cashflow amounts
(cfs - 现金流量)
public static double pmt(double r, double n, double p, double f, boolean t)
r
- rate
(r - 比率)
n
- num of periods
(n - 周期数)
p
- present value
(p - 现值)
f
- future value
(f - 未来价值)
t
- type (true=pmt at beginning of period, false=pmt at end of period)
(t - 类型(true=pmt 在期初,false=pmt 在期末))
public static double nper(double r, double y, double p, double f, boolean t)
r
- rate
(r - 比率)
y
- pmt per period
(y - 每期 pmt)
p
- present value
(p - 现值)
f
- future value
(f - 未来价值)
t
- type (true=pmt at beginning of period, false=pmt at end of period)
(t - 类型(true=pmt 在期初,false=pmt 在期末))
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.