Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
ef2f6b5f
Commit
ef2f6b5f
authored
Jun 15, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add F.INV.RT formula
parent
0bbc4054
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
cell/.unit-tests/FormulaTests.js
cell/.unit-tests/FormulaTests.js
+10
-0
cell/model/FormulaObjects/statisticalFunctions.js
cell/model/FormulaObjects/statisticalFunctions.js
+59
-1
No files found.
cell/.unit-tests/FormulaTests.js
View file @
ef2f6b5f
...
@@ -1029,6 +1029,16 @@ $( function () {
...
@@ -1029,6 +1029,16 @@ $( function () {
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
0.10930991
,
"
F.INV(A2,A3,A4)
"
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
0.10930991
,
"
F.INV(A2,A3,A4)
"
);
}
);
}
);
test
(
"
Test:
\"
F.INV.RT
\"
"
,
function
()
{
ws
.
getRange2
(
"
A2
"
).
setValue
(
"
0.01
"
);
ws
.
getRange2
(
"
A3
"
).
setValue
(
"
6
"
);
ws
.
getRange2
(
"
A4
"
).
setValue
(
"
4
"
);
oParser
=
new
parserFormula
(
"
F.INV.RT(A2,A3,A4)
"
,
"
A1
"
,
ws
);
ok
(
oParser
.
parse
(),
"
F.INV.RT(A2,A3,A4)
"
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
5
)
-
0
,
15.20686
,
"
F.INV.RT(A2,A3,A4)
"
);
}
);
test
(
"
Test:
\"
GAMMA
\"
"
,
function
()
{
test
(
"
Test:
\"
GAMMA
\"
"
,
function
()
{
oParser
=
new
parserFormula
(
"
GAMMA(2.5)
"
,
"
A1
"
,
ws
);
oParser
=
new
parserFormula
(
"
GAMMA(2.5)
"
,
"
A1
"
,
ws
);
ok
(
oParser
.
parse
(),
"
GAMMA(2.5)
"
);
ok
(
oParser
.
parse
(),
"
GAMMA(2.5)
"
);
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
ef2f6b5f
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
cFormulaFunctionGroup
[
'
Statistical
'
]
=
cFormulaFunctionGroup
[
'
Statistical
'
]
||
[];
cFormulaFunctionGroup
[
'
Statistical
'
]
=
cFormulaFunctionGroup
[
'
Statistical
'
]
||
[];
cFormulaFunctionGroup
[
'
Statistical
'
].
push
(
cAVEDEV
,
cAVERAGE
,
cAVERAGEA
,
cAVERAGEIF
,
cAVERAGEIFS
,
cBETADIST
,
cBETA_DIST
,
cFormulaFunctionGroup
[
'
Statistical
'
].
push
(
cAVEDEV
,
cAVERAGE
,
cAVERAGEA
,
cAVERAGEIF
,
cAVERAGEIFS
,
cBETADIST
,
cBETA_DIST
,
cBETA_INV
,
cBINOMDIST
,
cCHIDIST
,
cCHIINV
,
cCHISQ_DIST
,
cCHISQ_DIST_RT
,
cCHISQ_INV
,
cCHISQ_INV_RT
,
cCHITEST
,
cCONFIDENCE
,
cCORREL
,
cCOUNT
,
cCOUNTA
,
cCOUNTBLANK
,
cCOUNTIF
,
cBETA_INV
,
cBINOMDIST
,
cCHIDIST
,
cCHIINV
,
cCHISQ_DIST
,
cCHISQ_DIST_RT
,
cCHISQ_INV
,
cCHISQ_INV_RT
,
cCHITEST
,
cCONFIDENCE
,
cCORREL
,
cCOUNT
,
cCOUNTA
,
cCOUNTBLANK
,
cCOUNTIF
,
cCOUNTIFS
,
cCOVAR
,
cCRITBINOM
,
cDEVSQ
,
cEXPONDIST
,
cFDIST
,
cF_DIST
,
cF_DIST_RT
,
cF_INV
,
cFINV
,
cFISHER
,
cFISHERINV
,
cFORECAST
,
cFREQUENCY
,
cCOUNTIFS
,
cCOVAR
,
cCRITBINOM
,
cDEVSQ
,
cEXPONDIST
,
cFDIST
,
cF_DIST
,
cF_DIST_RT
,
cF_INV
,
cF
_INV_RT
,
cF
INV
,
cFISHER
,
cFISHERINV
,
cFORECAST
,
cFREQUENCY
,
cFTEST
,
cGAMMA
,
cGAMMADIST
,
cGAMMAINV
,
cGAMMA_DIST
,
cGAMMA_INV
,
cGAMMALN
,
cGAMMALN_PRECISE
,
cGEOMEAN
,
cGROWTH
,
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cFTEST
,
cGAMMA
,
cGAMMADIST
,
cGAMMAINV
,
cGAMMA_DIST
,
cGAMMA_INV
,
cGAMMALN
,
cGAMMALN_PRECISE
,
cGEOMEAN
,
cGROWTH
,
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cLINEST
,
cLOGEST
,
cLOGINV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cNEGBINOMDIST
,
cNORMDIST
,
cLINEST
,
cLOGEST
,
cLOGINV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cNEGBINOMDIST
,
cNORMDIST
,
cNORMINV
,
cNORMSDIST
,
cNORMSINV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTRANK
,
cPERMUT
,
cPOISSON
,
cPROB
,
cQUARTILE
,
cNORMINV
,
cNORMSDIST
,
cNORMSINV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTRANK
,
cPERMUT
,
cPOISSON
,
cPROB
,
cQUARTILE
,
...
@@ -2827,6 +2827,64 @@
...
@@ -2827,6 +2827,64 @@
};
};
};
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cF_INV_RT
()
{
cBaseFunction
.
call
(
this
,
"
F.INV.RT
"
);
}
//clone cFINV formula
cF_INV_RT
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cF_INV_RT
.
prototype
.
constructor
=
cF_INV_RT
;
cF_INV_RT
.
prototype
.
argumentsMin
=
3
;
cF_INV_RT
.
prototype
.
argumentsMax
=
3
;
cF_INV_RT
.
prototype
.
Calculate
=
function
(
arg
)
{
var
oArguments
=
this
.
_prepareArguments
(
arg
,
arguments
[
1
],
true
);
var
argClone
=
oArguments
.
args
;
argClone
[
0
]
=
argClone
[
0
].
tocNumber
();
argClone
[
1
]
=
argClone
[
1
].
tocNumber
();
argClone
[
2
]
=
argClone
[
2
].
tocNumber
();
var
argError
;
if
(
argError
=
this
.
_checkErrorArg
(
argClone
))
{
return
this
.
value
=
argError
;
}
var
calcFDist
=
function
(
argArray
){
var
fP
=
argArray
[
0
];
var
fF1
=
parseInt
(
argArray
[
1
]);
var
fF2
=
parseInt
(
argArray
[
2
]);
if
(
fP
<=
0
||
fF1
<
1
||
fF2
<
1
||
fF1
>=
1.0E10
||
fF2
>=
1.0E10
||
fP
>
1
){
return
new
cError
(
cErrorType
.
not_numeric
);
}
var
aFunc
=
new
FDISTFUNCTION
(
fP
,
fF1
,
fF2
);
var
oVal
=
iterateInverse
(
aFunc
,
fF1
*
0.5
,
fF1
);
var
bConvError
=
oVal
.
bError
;
if
(
bConvError
){
return
new
cError
(
cErrorType
.
not_numeric
);
}
var
res
=
oVal
.
val
;
return
null
!==
res
&&
!
isNaN
(
res
)
?
new
cNumber
(
res
)
:
new
cError
(
cErrorType
.
wrong_value_type
);
};
if
(
argClone
[
1
].
getValue
()
<
1
){
return
this
.
value
=
new
cError
(
cErrorType
.
not_numeric
);
}
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
calcFDist
);
};
cF_INV_RT
.
prototype
.
getInfo
=
function
()
{
return
{
name
:
this
.
name
,
args
:
"
(probability, deg_freedom1, deg_freedom2)
"
};
};
/**
/**
* @constructor
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
* @extends {AscCommonExcel.cBaseFunction}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment