summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr3.cxx
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2013-12-03 18:03:29 +0100
committerEike Rathke <erack@redhat.com>2013-12-03 19:00:38 +0100
commita4332ca8536242d7975146bcd700ecb0acb88f31 (patch)
tree8b29a273675a98947c834a5953bac1c326d3475b /sc/source/core/tool/interpr3.cxx
parent3dbe28273f963b1b20312eb27869bb3f5cccae7c (diff)
fdo#70797 fix incorrect argument handling of CHISQ.DIST
Change-Id: I6187aa673034e6dc18f48f7b6b7ac88989ab55ec Reviewed-on: https://gerrit.libreoffice.org/6914 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit c3760e9099db9cf1be696347e2a0743a3cae1b20)
Diffstat (limited to 'sc/source/core/tool/interpr3.cxx')
-rw-r--r--sc/source/core/tool/interpr3.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 0cb0cc8b902a..8fa0a0e5791d 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -721,6 +721,30 @@ void ScInterpreter::ScChiSqDist()
}
}
+void ScInterpreter::ScChiSqDist_MS()
+{
+ sal_uInt8 nParamCount = GetByte();
+ if ( !MustHaveParamCount( nParamCount, 3, 3 ) )
+ return;
+ bool bCumulative = GetBool();
+ double fDF = ::rtl::math::approxFloor( GetDouble() );
+ if ( fDF < 1.0 || fDF > 1E10 )
+ PushIllegalArgument();
+ else
+ {
+ double fX = GetDouble();
+ if ( fX < 0 )
+ PushIllegalArgument();
+ else
+ {
+ if ( bCumulative )
+ PushDouble( GetChiSqDistCDF( fX, fDF ) );
+ else
+ PushDouble( GetChiSqDistPDF( fX, fDF ) );
+ }
+ }
+}
+
void ScInterpreter::ScGamma()
{
double x = GetDouble();