Coupnum fix (#1069)

* New Unit Tests for COUPNUM()

* COUPNUM should not return zero when settlement is in the last period

* Additional tests and fixes for COUPNCD() and COUPPCD() functions

* Additional tests and fixes for COUPNCD() and COUPPCD() functions
This commit is contained in:
Mark Baker 2019-07-10 22:41:28 +02:00 committed by GitHub
parent 0ea97f14e1
commit de3f948b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -417,7 +417,7 @@ class Financial
return Functions::VALUE();
}
if (($settlement > $maturity) ||
if (($settlement >= $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
return Functions::NAN();
@ -476,7 +476,7 @@ class Financial
return Functions::VALUE();
}
if (($settlement > $maturity) ||
if (($settlement >= $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
return Functions::NAN();
@ -550,7 +550,7 @@ class Financial
return Functions::VALUE();
}
if (($settlement > $maturity) ||
if (($settlement >= $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
return Functions::NAN();