From cd0bc28e7c7c85e36e5b600e154f6517c52ff0fd Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Thu, 17 May 2012 09:10:54 +0200
Subject: [PATCH] Fixed bug in getPowerDeriv.m where the nth derivative of 0^n
 evaluated to 0 instead of n!

---
 matlab/getPowerDeriv.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/getPowerDeriv.m b/matlab/getPowerDeriv.m
index e87eabe1e0..ab8d6220e8 100644
--- a/matlab/getPowerDeriv.m
+++ b/matlab/getPowerDeriv.m
@@ -30,7 +30,7 @@ function dxp=getPowerDeriv(x,p,k)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-if (abs(x) < 1e-12) && (p > 0) && (k >= p) && (abs(p - round(p)) < 1e-12)
+if (abs(x) < 1e-12) && (p > 0) && (k > p) && (abs(p - round(p)) < 1e-12)
     dxp = 0;
 else
     dxp = x^(p-k);
-- 
GitLab