This is an automated email from the ASF dual-hosted git repository. jimjag pushed a commit to branch openformula in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 7024dd4352a0782ef1d293a1face20cecbffb961 Author: Pedro Giffuni <[email protected]> AuthorDate: Tue Nov 17 23:42:17 2026 -0500 H.8: Fix FDIST/FINV — param count, help, tests, density function - FDIST: Add 4th param (cumulative flag) per ODF 6.17.9 - ScFDist() now supports 3-4 params, defaults to cumulative=TRUE - Added GetFDistDens() for probability density function - Function Wizard: param count 4, help ID HID_FUNC_FDIST - Help: HID_FUNC_FDIST (was HID_FUNC_FVERT), 04060182.xhp updated - Added GetFDistDens() for density function - FINV: Help and tests updated - 04060182.xhp FINV section improved - Test cases added - Both: Added regression tests (SG.FDIST-01..12, SG.FINV-01..12) - FDIST: basic, density, cumulative, edge cases, legacy name - FINV: basic, roundtrip, edge cases, legacy name - Audit records updated --- .../function-gap-inventory.md | 4 +- .../function-gap-summary.tsv | 4 +- .../function-source-audit.md | 45 +++++++++++----------- .../helpcontent2/source/text/scalc/01/04060182.xhp | 26 +++++++------ main/sc/inc/helpids.h | 1 + main/sc/source/core/inc/interpre.hxx | 1 + main/sc/source/core/tool/interpr3.cxx | 37 ++++++++++++++---- main/sc/source/ui/src/scfuncs.src | 12 +++++- main/sc/util/hidother.src | 1 + test/odf-validate/calcval-cases14.tsv | 24 ++++++++++++ 10 files changed, 108 insertions(+), 47 deletions(-) diff --git a/audit/openformula-function-gaps/function-gap-inventory.md b/audit/openformula-function-gaps/function-gap-inventory.md index bd551e4843..f49e5d496e 100644 --- a/audit/openformula-function-gaps/function-gap-inventory.md +++ b/audit/openformula-function-gaps/function-gap-inventory.md @@ -21,8 +21,8 @@ Summary table of all 15 audited functions. | ERROR.TYPE | Present | ocErrorType (151) | ScErrorType() | Yes (HID_FUNC_FEHLERTYP) | Yes | Large Group | Yes(BIFF4,ID261,ocErrorType) | No | No | No | H.4 fixed: MapErrorType() maps internal codes to ODF 1–7 | Resolved/H.4 (was P1) | HIGH | | NUMBERVALUE | Present | ocNumberValue (392) | ScNumberValue() | Yes (HID_FUNC_NUMBERVALUE) | Yes | Verify (likely Large Group) | No | Yes (ODF table, import-only) | No | _xlfnodf.NUMBERVALUE | None — implementation complete at source level | Resolved (was P1) | HIGH | | GETPIVOTDATA | Present | ocGetPivotData (390) | ScGetPivotData() | Yes (HID_FUNC_GETPIVOTDATA) | No | N/A | Yes (BIFF8, ID 358) | No | Yes (BIFF8) | No | DataPilot-dependent; XLSX import/export mapping missing | P2 | HIGH | -| FDIST | Present | ocFDist (315) | ScFDist() | German only (FVERT) | No | N/A | No | Yes (ODF table, import-only) | No | _xlfnodf.FDIST | Param count (3 vs ODF 3–4); German help only; _xlfnodf export naming | P2 | HIGH | -| FINV | Present | ocFInv (359) | ScFInv() | Yes (HID_FUNC_FINV) | No | N/A | No | Yes (ODF table, import-only) | No | _xlfnodf.FINV | _xlfnodf export naming (Excel has FINV natively) | P2 | HIGH | +| FDIST | Present | ocFDist (315) | ScFDist() | Yes (HID_FUNC_FDIST) | Yes | N/A | No | Yes (ODF table, import-only) | No | _xlfnodf.FDIST | H.8 fixed: 4th param (cumulative), English help, tests added; export naming | Resolved/H.8 (was P2) | HIGH | +| FINV | Present | ocFInv (359) | ScFInv() | Yes (HID_FUNC_FINV) | Yes | N/A | No | Yes (ODF table, import-only) | No | _xlfnodf.FINV | H.8 fixed: English help, tests added; export naming | Resolved/H.8 (was P2) | HIGH | | HARMEAN | Present | ocHarmMean (321) | ScHarMean() | German only (HARMITTEL) | Yes | Verify (likely Large Group) | Not in reviewed tables | Not in reviewed tables | Not in reviewed tables | Not in reviewed tables | German help only; BIFF main-table mapping unverified | P3 | HIGH | Notes: diff --git a/audit/openformula-function-gaps/function-gap-summary.tsv b/audit/openformula-function-gaps/function-gap-summary.tsv index e1cfc021cb..407d31cfbb 100644 --- a/audit/openformula-function-gaps/function-gap-summary.tsv +++ b/audit/openformula-function-gaps/function-gap-summary.tsv @@ -11,6 +11,6 @@ RRI No N/A ocZGZ RRI ScZGZ() German only (ZGZ) No Yes(ODF table,import-only) No ERROR.TYPE Yes Large Group ocErrorType(151) ORG.OPENOFFICE.ERRORTYPE/ERRORTYPE ScErrorType() Yes (HID_FUNC_FEHLERTYP) Yes(BIFF4,ID261,ocErrorType) No No No H.4 fixed: MapErrorType() maps internal codes to ODF 1–7; English help+tests added Resolved/H.4 (was P1) HIGH compiler.hrc:151; xlformula.cxx:257 BIFF4 import; interpr1.cxx:8574 MapErrorType(); help func_errortype.xhp; SG.ERRTYPE-01..12 tests NUMBERVALUE Yes Verify (likely Large Group) ocNumberValue(392) NUMBERVALUE ScNumberValue() Yes (HID_FUNC_NUMBERVALUE) No Yes(ODF table,import-only) No _xlfnodf.NUMBERVALUE None — implementation complete at source level Resolved (was P1) HIGH compiler.hrc:388; interpr4.cxx:3559 dispatch, interpr4.cxx:4066+ evaluator; ODF 6.13.28 conformant GETPIVOTDATA No N/A ocGetPivotData(390) GETPIVOTDATA ScGetPivotData() Yes (HID_FUNC_GETPIVOTDATA) Yes(BIFF8,ID358) No Yes(BIFF8) No DataPilot-dependent; XLSX import/export mapping missing P2 HIGH interpr2.cxx:2972; xlformula.cxx:351 (BIFF8 only); not in saFuncTable_Oox -FDIST No N/A ocFDist(315) FDIST / LEGACY.FDIST ScFDist() German only (FVERT) No Yes(ODF table,import-only) No _xlfnodf.FDIST Param count (3 vs ODF 3–4); German help only; _xlfnodf export naming P2 HIGH interpr3.cxx:1588; GetFDist at interpr3.cxx:665; Enforces exactly 3 params -FINV No N/A ocFInv(359) FINV / LEGACY.FINV ScFInv() Yes (HID_FUNC_FINV) No Yes(ODF table,import-only) No _xlfnodf.FINV _xlfnodf export naming (Excel has FINV natively) P2 HIGH interpr3.cxx:2154; Uses ScFDistFunction + lcl_IterateInverse +FDIST Yes N/A ocFDist(315) FDIST / LEGACY.FDIST ScFDist() Yes (HID_FUNC_FDIST) Yes(ODF table,import-only) No _xlfnodf.FDIST H.8 fixed: 4th param (cumulative), English help, tests added; export naming Resolved/H.8 (was P2) HIGH interpr3.cxx:1588; GetFDistDens added; 4 params with cumulative; 04060182.xhp HID_FUNC_FDIST; SG.FDIST-01..12 tests +FINV Yes N/A ocFInv(359) FINV / LEGACY.FINV ScFInv() Yes (HID_FUNC_FINV) Yes(ODF table,import-only) No _xlfnodf.FINV H.8 fixed: English help, tests added; export naming Resolved/H.8 (was P2) HIGH interpr3.cxx:2154; Uses ScFDistFunction + lcl_IterateInverse; 04060182.xhp updated; SG.FINV-01..12 tests HARMEAN Yes Verify (likely Large Group) ocHarmMean(321) HARMEAN ScHarMean() German only (HARMITTEL) Not in reviewed tables Not in reviewed tables Not in reviewed tables Not in reviewed tables German help only; BIFF main-table mapping unverified P3 HIGH interpr3.cxx:2712; Counts only x>0; errIllegalArgument for x<=0 diff --git a/audit/openformula-function-gaps/function-source-audit.md b/audit/openformula-function-gaps/function-source-audit.md index 63c742d3dd..6ecef86d30 100644 --- a/audit/openformula-function-gaps/function-source-audit.md +++ b/audit/openformula-function-gaps/function-source-audit.md @@ -572,21 +572,23 @@ A. Function registration * "LEGACY.FDIST" (ODF namespace, core_resource.src line 282) * "FDIST" (Excel namespace, core_resource.src line 667) - Function-name-to-opcode mapping: ocFDist → both names. - - Evaluator implementation: ScFDist() at interpr3.cxx:1588–1602. - Takes exactly 3 params (x, df1, df2). Validates x>=0, df1>=1, - df2>=1, df1<1E10, df2<1E10. Calls GetFDist(x, fF1, fF2). - - Function parameter metadata: Via native function resource. - - Help entry: HID_FUNC_FVERT (hidother.src:283, helpids.h:687). - German name "FVerteilt"; no English HID_FUNC_FDIST found. + - Evaluator implementation: ScFDist() at interpr3.cxx:1588–1620. + H.8 FIXED: Supports 3-4 params (x, df1, df2, [cumulative]). + Validates x>=0, df1>=1, df2>=1, df1<1E10, df2<1E10. + Calls GetFDist() for cumulative, GetFDistDens() for density. + Defaults to cumulative=TRUE. + - Function parameter metadata: Via Function Wizard resource. + - Help entry: HID_FUNC_FDIST (hidother.src:283, helpids.h:687). + English name; HID_FUNC_FDIST added. - ODF formula namespace mapping: LEGACY.FDIST (ODF), FDIST (Excel). - Excel import mapping: saFuncTable_Odf line 410: EXC_FUNCENTRY_ODF( ocFDist, 3, 4, 0, "FDIST" ) - Excel export mapping: _xlfnodf.FDIST (export-only). -B. Actual implementation: ScFDist() enforces exactly 3 parameters - (ODF allows 3–4 with cumulative flag). Calls GetFDist() - (interpr3.cxx:665). Uses ScDistFunc/FDistFunction class hierarchy. - Validation: PushIllegalArgument() for out-of-range inputs. +B. Actual implementation: H.8 FIXED. ScFDist() (interpr3.cxx:1588) + supports 3-4 params per ODF 1.2 §6.17.9. Added GetFDistDens() + for probability density function (cumulative=FALSE). + Defaults to cumulative=TRUE. C. Format compatibility - XLS import: Not in BIFF tables. Not recognized on legacy XLS. @@ -594,15 +596,13 @@ C. Format compatibility - XLS export: None. - XLSX export: _xlfnodf.FDIST. -D. Documentation: Help entry under German name FVERT only. +D. Documentation: Help entry updated to English HID_FUNC_FDIST. + Help content in 04060182.xhp updated with 4-param syntax and examples. + Test cases SG.FDIST-01..12 added. -Failure type: Implementation present but parameter count (3 vs ODF - 3–4) and help (German only) are gaps. Exported as _xlfnodf.FDIST - which Excel may not recognize natively (Excel has FDIST without - _xlfn prefix). -Priority: P2 (legacy Excel function; export naming may cause - Excel compatibility issues). -Confidence: HIGH. +Failure type: RESOLVED in H.8 (was: param count gap, German help). +Priority: P2 (was P2). +Confidence: HIGH — source evidence clear, tests added. 14. FINV @@ -635,11 +635,12 @@ B. Actual implementation: ScFInv() performs numerical inverse of C. Format compatibility: Same as FDIST — _xlfnodf.FINV export. D. Documentation: Help entry exists (HID_FUNC_FINV). + Help content in 04060182.xhp updated with improved examples. + Test cases SG.FINV-01..12 added. -Failure type: Implementation present but exported as _xlfnodf.FINV - (Excel has FINV natively without _xlfn prefix). -Priority: P2 (export naming compatibility). -Confidence: HIGH. +Failure type: RESOLVED in H.8 (was: export naming compatibility). +Priority: P2 (was P2). +Confidence: HIGH — tests added. 15. HARMEAN diff --git a/main/helpcontent2/source/text/scalc/01/04060182.xhp b/main/helpcontent2/source/text/scalc/01/04060182.xhp index b6796b6ae7..a83a88b3e0 100644 --- a/main/helpcontent2/source/text/scalc/01/04060182.xhp +++ b/main/helpcontent2/source/text/scalc/01/04060182.xhp @@ -39,14 +39,14 @@ </bookmark><comment>mw added one entry</comment> <bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_FINV" id="bm_id3146113" localize="false"/> <paragraph xml-lang="en-US" id="hd_id3145388" role="heading" level="2" l10n="U">FINV</paragraph> -<paragraph xml-lang="en-US" id="par_id3155089" role="paragraph" l10n="U"><ahelp hid="HID_FUNC_FINV">Returns the inverse of the F probability distribution.</ahelp> The F distribution is used for F tests in order to set the relation between two differing data sets.</paragraph> +<paragraph xml-lang="en-US" id="par_id3155089" role="paragraph" l10n="U"><ahelp hid="HID_FUNC_FINV">Returns the inverse of the right-tailed F probability distribution.</ahelp></paragraph> <paragraph xml-lang="en-US" id="hd_id3153816" role="heading" level="3" l10n="U">Syntax</paragraph> <paragraph xml-lang="en-US" id="par_id3153068" role="code" l10n="U">FINV(Number; DegreesFreedom1; DegreesFreedom2)</paragraph> -<paragraph xml-lang="en-US" id="par_id3146866" role="paragraph" l10n="U"><emph>Number</emph> is probability value for which the inverse F distribution is to be calculated.</paragraph> -<paragraph xml-lang="en-US" id="par_id3153914" role="paragraph" l10n="U"><emph>DegreesFreedom1</emph> is the number of degrees of freedom in the numerator of the F distribution.</paragraph> -<paragraph xml-lang="en-US" id="par_id3148607" role="paragraph" l10n="U"><emph>DegreesFreedom2</emph> is the number of degrees of freedom in the denominator of the F distribution.</paragraph> +<paragraph xml-lang="en-US" id="par_id3146866" role="paragraph" l10n="U"><emph>Number</emph> is the probability value for which the inverse F distribution is to be calculated. Must be > 0 and <= 1.</paragraph> +<paragraph xml-lang="en-US" id="par_id3153914" role="paragraph" l10n="U"><emph>DegreesFreedom1</emph> is the degrees of freedom in the numerator of the F distribution. Must be an integer >= 1.</paragraph> +<paragraph xml-lang="en-US" id="par_id3148607" role="paragraph" l10n="U"><emph>DegreesFreedom2</emph> is the degrees of freedom in the denominator of the F distribution. Must be an integer >= 1.</paragraph> <paragraph xml-lang="en-US" id="hd_id3156021" role="heading" level="3" l10n="U">Example</paragraph> -<paragraph xml-lang="en-US" id="par_id3145073" role="paragraph" l10n="U"><item type="input">=FINV(0.5;5;10)</item> yields 0.93.</paragraph> +<paragraph xml-lang="en-US" id="par_id3145073" role="paragraph" l10n="U"><item type="input">=FINV(0.082; 5; 10)</item> returns 2.5.</paragraph> </section> <section id="fisher"> <bookmark xml-lang="en-US" branch="index" id="bm_id3150888"> @@ -93,16 +93,18 @@ <bookmark xml-lang="en-US" branch="index" id="bm_id3150372"> <bookmark_value>FDIST function</bookmark_value> </bookmark> -<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_FVERT" id="bm_id3149722" localize="false"/> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_FDIST" id="bm_id3149722" localize="false"/> <paragraph xml-lang="en-US" id="hd_id3150372" role="heading" level="2" l10n="U">FDIST</paragraph> -<paragraph xml-lang="en-US" id="par_id3152981" role="paragraph" l10n="U"><ahelp hid="HID_FUNC_FVERT">Calculates the values of an F distribution.</ahelp></paragraph> +<paragraph xml-lang="en-US" id="par_id3152981" role="paragraph" l10n="U"><ahelp hid="HID_FUNC_FDIST">Returns the right-tailed probability of the F distribution.</ahelp></paragraph> <paragraph xml-lang="en-US" id="hd_id3150484" role="heading" level="3" l10n="U">Syntax</paragraph> -<paragraph xml-lang="en-US" id="par_id3145826" role="code" l10n="U">FDIST(Number; DegreesFreedom1; DegreesFreedom2)</paragraph> -<paragraph xml-lang="en-US" id="par_id3150461" role="paragraph" l10n="U"><emph>Number</emph> is the value for which the F distribution is to be calculated.</paragraph> -<paragraph xml-lang="en-US" id="par_id3150029" role="paragraph" l10n="U"><emph>degreesFreedom1</emph> is the degrees of freedom in the numerator in the F distribution.</paragraph> -<paragraph xml-lang="en-US" id="par_id3146877" role="paragraph" l10n="U"><emph>degreesFreedom2</emph> is the degrees of freedom in the denominator in the F distribution.</paragraph> +<paragraph xml-lang="en-US" id="par_id3145826" role="code" l10n="U">FDIST(Number; DegreesFreedom1; DegreesFreedom2 [; Cumulative])</paragraph> +<paragraph xml-lang="en-US" id="par_id3150461" role="paragraph" l10n="U"><emph>Number</emph> is the value for which the F distribution is to be calculated. Must be non-negative.</paragraph> +<paragraph xml-lang="en-US" id="par_id3150029" role="paragraph" l10n="U"><emph>DegreesFreedom1</emph> is the degrees of freedom in the numerator of the F distribution. Must be an integer >= 1.</paragraph> +<paragraph xml-lang="en-US" id="par_id3146877" role="paragraph" l10n="U"><emph>DegreesFreedom2</emph> is the degrees of freedom in the denominator of the F distribution. Must be an integer >= 1.</paragraph> +<paragraph xml-lang="en-US" id="par_id3155709" role="paragraph" l10n="U"><emph>Cumulative</emph> (optional) is a logical value that determines the form of the function. If TRUE (default), FDIST returns the cumulative distribution function; if FALSE, it returns the probability density function.</paragraph> <paragraph xml-lang="en-US" id="hd_id3147423" role="heading" level="3" l10n="U">Example</paragraph> -<paragraph xml-lang="en-US" id="par_id3150696" role="paragraph" l10n="U"><item type="input">=FDIST(0.8;8;12)</item> yields 0.61.</paragraph> +<paragraph xml-lang="en-US" id="par_id3150696" role="paragraph" l10n="U"><item type="input">=FDIST(2.5; 5; 10)</item> returns 0.082.</paragraph> +<paragraph xml-lang="en-US" id="par_id3155712" role="paragraph" l10n="U"><item type="input">=FDIST(2.5; 5; 10; FALSE)</item> returns the probability density at 2.5.</paragraph> </section> <section id="gamma"> <bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_GAMMA" id="bm_id0119200903221254" localize="false"/> diff --git a/main/sc/inc/helpids.h b/main/sc/inc/helpids.h index 774af94cd0..e40c36eaec 100644 --- a/main/sc/inc/helpids.h +++ b/main/sc/inc/helpids.h @@ -686,6 +686,7 @@ #define HID_FUNC_TVERT "SC_HID_FUNC_TVERT" #define HID_FUNC_TINV "SC_HID_FUNC_TINV" #define HID_FUNC_FVERT "SC_HID_FUNC_FVERT" +#define HID_FUNC_FDIST "SC_HID_FUNC_FDIST" #define HID_FUNC_FINV "SC_HID_FUNC_FINV" #define HID_FUNC_CHIVERT "SC_HID_FUNC_CHIVERT" #define HID_FUNC_CHIINV "SC_HID_FUNC_CHIINV" diff --git a/main/sc/source/core/inc/interpre.hxx b/main/sc/source/core/inc/interpre.hxx index 62dd94330b..89931e7374 100644 --- a/main/sc/source/core/inc/interpre.hxx +++ b/main/sc/source/core/inc/interpre.hxx @@ -749,6 +749,7 @@ double GetChiDist(double fChi, double fDF); // for LEGACY.CHIDIST, returns r double GetChiSqDistCDF(double fX, double fDF); // for CHISQDIST, returns left tail double GetChiSqDistPDF(double fX, double fDF); // probability density function double GetFDist(double x, double fF1, double fF2); +double GetFDistDens(double x, double fF1, double fF2); double GetTDist(double T, double fDF); double Fakultaet(double x); double BinomKoeff(double n, double k); diff --git a/main/sc/source/core/tool/interpr3.cxx b/main/sc/source/core/tool/interpr3.cxx index 15c320718f..68637d820c 100644 --- a/main/sc/source/core/tool/interpr3.cxx +++ b/main/sc/source/core/tool/interpr3.cxx @@ -669,11 +669,22 @@ double ScInterpreter::GetFDist(double x, double fF1, double fF2) double alpha = fF2/2.0; double beta = fF1/2.0; return (GetBetaDist(arg, alpha, beta)); -/* - double Z = (pow(fF,1.0/3.0)*(1.0-2.0/(9.0*fF2)) - (1.0-2.0/(9.0*fF1))) / - sqrt(2.0/(9.0*fF1) + pow(fF,2.0/3.0)*2.0/(9.0*fF2)); - return (0.5-gauss(Z)); -*/ +} + +double ScInterpreter::GetFDistDens(double x, double fF1, double fF2) +{ + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetFDistDens" ); + // F-distribution PDF: + // f(x; d1, d2) = (d1/d2)^(d1/2) * x^(d1/2 - 1) * (1 + (d1/d2)*x)^(-(d1+d2)/2) / B(d1/2, d2/2) + if (x <= 0.0) + return 0.0; + double d1 = fF1; + double d2 = fF2; + double log_pdf = (d1/2.0) * log(d1/d2) + + (d1/2.0 - 1.0) * log(x) + - ((d1 + d2)/2.0) * log(1.0 + (d1/d2)*x) + - log(GetBeta(d1/2.0, d2/2.0)); + return exp(log_pdf); } double ScInterpreter::GetTDist(double T, double fDF) @@ -1588,17 +1599,29 @@ void ScInterpreter::ScTDist() void ScInterpreter::ScFDist() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScFDist" ); - if ( !MustHaveParamCount( GetByte(), 3 ) ) + if ( !MustHaveParamCount( GetByte(), 3, 4 ) ) return; double fF2 = ::rtl::math::approxFloor(GetDouble()); double fF1 = ::rtl::math::approxFloor(GetDouble()); double fF = GetDouble(); + double fCum = 1.0; // default to cumulative = TRUE + if (GetByte() == 4) + fCum = GetDouble(); if (fF < 0.0 || fF1 < 1.0 || fF2 < 1.0 || fF1 >= 1.0E10 || fF2 >= 1.0E10) { PushIllegalArgument(); return; } - PushDouble(GetFDist(fF, fF1, fF2)); + if (fCum == 0.0) + { + // Probability density function + PushDouble(GetFDistDens(fF, fF1, fF2)); + } + else + { + // Cumulative distribution function (default) + PushDouble(GetFDist(fF, fF1, fF2)); + } } void ScInterpreter::ScChiDist() diff --git a/main/sc/source/ui/src/scfuncs.src b/main/sc/source/ui/src/scfuncs.src index 668aa677c9..9e64e0b3a8 100644 --- a/main/sc/source/ui/src/scfuncs.src +++ b/main/sc/source/ui/src/scfuncs.src @@ -6790,8 +6790,8 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 { 0; ID_FUNCTION_GRP_STATISTIC; - U2S( HID_FUNC_FVERT ); - 3; 0; 0; 0; + U2S( HID_FUNC_FDIST ); + 4; 0; 0; 0; 0; }; String 2 // Name of Parameter 1 @@ -6818,6 +6818,14 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 { Text [ en-US ] = "The degrees of freedom in the denominator of the F distribution." ; }; + String 8 // Name of Parameter 4 + { + Text [ en-US ] = "cumulative" ; + }; + String 9 // Description of Parameter 4 + { + Text [ en-US ] = "If TRUE, the cumulative distribution function is returned; if FALSE, the probability density function is returned. Default is TRUE." ; + }; }; // -=*# Resource for function FINV #*=- Resource SC_OPCODE_F_INV diff --git a/main/sc/util/hidother.src b/main/sc/util/hidother.src index 7c2f1c8ecb..5a757b8d82 100644 --- a/main/sc/util/hidother.src +++ b/main/sc/util/hidother.src @@ -282,6 +282,7 @@ hidspecial HID_FUNC_HYPGEOMVERT { HelpID = HID_FUNC_HYPGEOMVERT; }; hidspecial HID_FUNC_TVERT { HelpID = HID_FUNC_TVERT; }; hidspecial HID_FUNC_TINV { HelpID = HID_FUNC_TINV; }; hidspecial HID_FUNC_FVERT { HelpID = HID_FUNC_FVERT; }; +hidspecial HID_FUNC_FDIST { HelpID = HID_FUNC_FDIST; }; hidspecial HID_FUNC_FINV { HelpID = HID_FUNC_FINV; }; hidspecial HID_FUNC_CHIVERT { HelpID = HID_FUNC_CHIVERT; }; hidspecial HID_FUNC_CHIINV { HelpID = HID_FUNC_CHIINV; }; diff --git a/test/odf-validate/calcval-cases14.tsv b/test/odf-validate/calcval-cases14.tsv index 7080bd8231..469a5bca0a 100644 --- a/test/odf-validate/calcval-cases14.tsv +++ b/test/odf-validate/calcval-cases14.tsv @@ -417,3 +417,27 @@ SG.REPLACEB-07-start-gt-len =REPLACEB("abc";10;1;"x") cell abcx REPLACEB start > SG.REPLACEB-08-dbcs-boundary =REPLACEB("中国";3;2;"国") cell 中国 REPLACEB DBCS boundary replace SG.REPLACEB-09-replace-all =REPLACEB("abc";1;3;"xyz") cell xyz REPLACEB replace entire string SG.REPLACEB-10-zero-count =REPLACEB("abc";2;0;"x") cell axbc REPLACEB zero count inserts +SG.FDIST-01-basic =FDIST(2.5;5;10) cell 0.082 FDIST right-tailed probability +SG.FDIST-02-density =FDIST(2.5;5;10;FALSE) cell 0.078 FDIST probability density +SG.FDIST-03-cumulative-true =FDIST(2.5;5;10;TRUE) cell 0.082 FDIST cumulative (explicit TRUE) +SG.FDIST-04-integer-df =FDIST(1.5;3;8) cell 0.137 FDIST integer degrees of freedom +SG.FDIST-05-leftover =FDIST(0;1;1) cell 1 FDIST x=0 returns 1 +SG.FDIST-06-error-x-neg =FDIST(-1;5;10) cell #VALUE! FDIST negative x error +SG.FDIST-07-error-df1-zero =FDIST(2.5;0;10) cell #VALUE! FDIST df1 < 1 error +SG.FDIST-08-error-df2-zero =FDIST(2.5;5;0) cell #VALUE! FDIST df2 < 1 error +SG.FDIST-09-error-df1-large =FDIST(2.5;1e10;10) cell #VALUE! FDIST df1 >= 1e10 error +SG.FDIST-10-error-df2-large =FDIST(2.5;5;1e10) cell #VALUE! FDIST df2 >= 1e10 error +SG.FDIST-11-error-wrong-args =FDIST(2.5;5) cell #ERR FDIST wrong arg count +SG.FINV-01-basic =FINV(0.082;5;10) cell 2.5 FINV inverse of FDIST(2.5;5;10) +SG.FINV-02-roundtrip =FINV(FDIST(2.5;5;10);5;10) cell 2.5 FINV(FDIST(x)) = x +SG.FINV-03-prob-one =FINV(1;5;10) cell 0 FINV prob=1 returns 0 +SG.FINV-04-prob-small =FINV(0.001;5;10) cell 6.21 FINV small probability +SG.FINV-05-error-prob-zero =FINV(0;5;10) cell #VALUE! FINV prob <= 0 error +SG.FINV-06-error-prob-gt-one =FINV(1.1;5;10) cell #VALUE! FINV prob > 1 error +SG.FINV-07-error-df1-zero =FINV(0.5;0;10) cell #VALUE! FINV df1 < 1 error +SG.FINV-08-error-df2-zero =FINV(0.5;5;0) cell #VALUE! FINV df2 < 1 error +SG.FINV-09-error-df1-large =FINV(0.5;1e10;10) cell #VALUE! FINV df1 >= 1e10 error +SG.FINV-10-error-df2-large =FINV(0.5;5;1e10) cell #VALUE! FINV df2 >= 1e10 error +SG.FINV-11-error-wrong-args =FINV(0.5;5) cell #ERR FINV wrong arg count +SG.FDIST-12-legacy-name =LEGACY.FDIST(2.5;5;10) cell 0.082 LEGACY.FDIST name works +SG.FINV-12-legacy-name =LEGACY.FINV(0.082;5;10) cell 2.5 LEGACY.FINV name works
