Allow negative interest rate in PPMT() Financial function (#2164)

This commit is contained in:
Mark Baker 2021-06-15 22:35:04 +02:00 committed by GitHub
parent 803737a893
commit ebdeb231eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -15,9 +15,6 @@ class CashFlowValidations extends FinancialValidations
public static function validateRate($rate): float
{
$rate = self::validateFloat($rate);
if ($rate < 0.0) {
throw new Exception(Functions::NAN());
}
return $rate;
}

View File

@ -5,6 +5,10 @@ return [
-75.623186008367,
[0.10 / 12, 1, 2 * 12, 2000],
],
[
-91.597714484189,
[-0.10 / 12, 1, 2 * 12, 2000],
],
[
-27598.053462421,
[0.08, 10, 10, 200000],