@@ 1187-1198 (lines=12) @@ | ||
1184 | * |
|
1185 | * @return float |
|
1186 | */ |
|
1187 | public static function EFFECT($nominal_rate = 0, $npery = 0) |
|
1188 | { |
|
1189 | $nominal_rate = Functions::flattenSingleValue($nominal_rate); |
|
1190 | $npery = (int) Functions::flattenSingleValue($npery); |
|
1191 | ||
1192 | // Validate parameters |
|
1193 | if ($nominal_rate <= 0 || $npery < 1) { |
|
1194 | return Functions::NAN(); |
|
1195 | } |
|
1196 | ||
1197 | return pow((1 + $nominal_rate / $npery), $npery) - 1; |
|
1198 | } |
|
1199 | ||
1200 | /** |
|
1201 | * FV. |
|
@@ 1533-1545 (lines=13) @@ | ||
1530 | * |
|
1531 | * @return float |
|
1532 | */ |
|
1533 | public static function NOMINAL($effect_rate = 0, $npery = 0) |
|
1534 | { |
|
1535 | $effect_rate = Functions::flattenSingleValue($effect_rate); |
|
1536 | $npery = (int) Functions::flattenSingleValue($npery); |
|
1537 | ||
1538 | // Validate parameters |
|
1539 | if ($effect_rate <= 0 || $npery < 1) { |
|
1540 | return Functions::NAN(); |
|
1541 | } |
|
1542 | ||
1543 | // Calculate |
|
1544 | return $npery * (pow($effect_rate + 1, 1 / $npery) - 1); |
|
1545 | } |
|
1546 | ||
1547 | /** |
|
1548 | * NPER. |