commit
message
Working on difference between F.DIST and FDIST.
author
Ben Vogt <[email protected]>
date
2017-01-08 20:22:19
stats
3 file(s) changed,
12 insertions(+),
2 deletions(-)
files
README.md
src/SupportedFormulas.ts
tests/SheetFormulaTest.ts
1diff --git a/README.md b/README.md
2index 80237e7..408eb28 100644
3--- a/README.md
4+++ b/README.md
5@@ -9,7 +9,7 @@ Things I should do.
6 * Include fail state values for all formulas
7
8 ### Write formulas for missing ones
9-* FDIST
10+* FDIST vs F.DIST, differentiate.
11 * FINV
12 * SIN
13 * SUMX2PY2
14diff --git a/src/SupportedFormulas.ts b/src/SupportedFormulas.ts
15index b781638..bc7ab69 100644
16--- a/src/SupportedFormulas.ts
17+++ b/src/SupportedFormulas.ts
18@@ -19,6 +19,7 @@ const SUPPORTED_FORMULAS = [
19 'TAN', 'TANH', 'TRUE', 'TRUNC',
20 'XOR'
21 ];
22+
23 const OverrideFormulas = {
24 ATAN2: function (x, y) {
25 return Math.atan2(y, x);
26diff --git a/tests/SheetFormulaTest.ts b/tests/SheetFormulaTest.ts
27index 0c4820b..aa5b143 100644
28--- a/tests/SheetFormulaTest.ts
29+++ b/tests/SheetFormulaTest.ts
30@@ -316,8 +316,16 @@ testFormula('=EXPONDIST(4, 0.5, false)', 0.06766764161830635);
31 testFormula('=FALSE()', false);
32
33 // Test FDIST
34-// TODO: This should work.
35-// testFormula('=FDIST(15.35, 7, 6)', 0.001930553432);
36+// TODO: In GS, this is really called F.DIST
37+/*
38+ * F.DIST Calculates the left-tailed F probability distribution (degree of diversity) for two data sets with given input x. Alternately called Fisher-Snedecor distribution or Snedecor's F distribution.
39+ * FDIST Calculates the right-tailed F probability distribution (degree of diversity) for two data sets with given input x. Alternately called Fisher-Snedecor distribution or Snedecor's F distribution.
40+ *
41+ * F.DIST is left-tailed. FDIST is right-tailed.
42+ */
43+testFormula('=FDIST(15.35, 7, 6, false)', 0.0003451054686025578);
44+testFormula('=FDIST(15.35, 7, 6, true)', 0.9980694465675269);
45+
46
47 // Test FINV
48 // TODO: This should work.