diff --git a/matlab/getPowerDeriv.m b/matlab/getPowerDeriv.m
index e87eabe1e026cebbf2361d8b8b749ba92892310c..ab8d6220e8aaea033e53c6cf340e2c410d0dcca2 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);