summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/inc/interpre.hxx1
-rw-r--r--sc/source/core/tool/interpr3.cxx24
-rw-r--r--sc/source/core/tool/interpr4.cxx4
3 files changed, 27 insertions, 2 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index e8eefa33bb68..f8fc0e9e1b45 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -754,6 +754,7 @@ void ScFDist();
void ScFDist_LT();
void ScChiDist(); // for LEGACY.CHIDIST, returns right tail
void ScChiSqDist(); // returns left tail or density
+void ScChiSqDist_MS();
void ScChiSqInv(); //invers to CHISQDIST
void ScWeibull();
void ScBetaDist();
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();
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index d230ac896872..c70fdf410fa1 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4118,8 +4118,8 @@ StackVar ScInterpreter::Interpret()
case ocFDist_LT : ScFDist_LT(); break;
case ocChiDist :
case ocChiDist_MS : ScChiDist(); break;
- case ocChiSqDist :
- case ocChiSqDist_MS : ScChiSqDist(); break;
+ case ocChiSqDist : ScChiSqDist(); break;
+ case ocChiSqDist_MS : ScChiSqDist_MS(); break;
case ocStandard : ScStandard(); break;
case ocAveDev : ScAveDev(); break;
case ocDevSq : ScDevSq(); break;