From 003c2cfaa258e204402a366a105366da74e220a2 Mon Sep 17 00:00:00 2001 From: Winfried Donkers Date: Wed, 6 Sep 2017 16:52:05 +0200 Subject: tdf#112177 remove incorrect constraint for Calc function NPER. Change-Id: I123ea8ee2e333665ac448c6b3814c3bac0b687ab Reviewed-on: https://gerrit.libreoffice.org/42011 Tested-by: Jenkins Reviewed-by: Eike Rathke --- sc/qa/unit/data/functions/financial/fods/nper.fods | 36 ++++++++++++++++------ sc/source/core/tool/interpr2.cxx | 2 -- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/sc/qa/unit/data/functions/financial/fods/nper.fods b/sc/qa/unit/data/functions/financial/fods/nper.fods index 22c06f914a25..2eac9b8f339f 100644 --- a/sc/qa/unit/data/functions/financial/fods/nper.fods +++ b/sc/qa/unit/data/functions/financial/fods/nper.fods @@ -1528,20 +1528,20 @@ - - Err:502 + + 27.6208695898296 - - Err:502 + + 27.6208695898296 - - TRUE + + WAAR - - =NPER(0.06/52, 0, 8000, 0 ,2) + + =NPER(0,06; 0; -80; 400 ;2) - No payment, no result + future value achieved with interest from present value @@ -1569,6 +1569,24 @@ + + + #NUM! + ++ ++ #NUM! + + + WAAR + + + =NPER(0,06; 0; 80; 400 ;2) + + + future value cannot be achieved with interest from present value + + + diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 72a8777e6149..588932de9162 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2004,8 +2004,6 @@ void ScInterpreter::ScNper() // amount to be paid to get from fPV to fFV is fFV_+_fPV. if ( fPV + fFV == 0.0 ) PushDouble( 0.0 ); - else if ( fPmt == 0.0 ) - PushIllegalArgument(); // No payment, future value can never be reached else if (fInterest == 0.0) PushDouble(-(fPV + fFV)/fPmt); else if (bPayInAdvance) -- cgit v1.2.3