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
d8f526d7
Commit
d8f526d7
authored
Jul 11, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add NORM.S.DIST formula
parent
b43c990b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
22 deletions
+63
-22
cell/.unit-tests/FormulaTests.js
cell/.unit-tests/FormulaTests.js
+13
-1
cell/model/FormulaObjects/_xlfnFunctions.js
cell/model/FormulaObjects/_xlfnFunctions.js
+4
-19
cell/model/FormulaObjects/statisticalFunctions.js
cell/model/FormulaObjects/statisticalFunctions.js
+46
-2
No files found.
cell/.unit-tests/FormulaTests.js
View file @
d8f526d7
...
@@ -4028,7 +4028,19 @@ $( function () {
...
@@ -4028,7 +4028,19 @@ $( function () {
}
);
}
);
test
(
"
Test:
\"
NEGBINOMDIST
\"
"
,
function
()
{
test
(
"
Test:
\"
NORM.S.DIST
\"
"
,
function
()
{
oParser
=
new
parserFormula
(
"
NORM.S.DIST(1.333333,TRUE)
"
,
"
A1
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
9
)
-
0
,
0.908788726
);
oParser
=
new
parserFormula
(
"
NORM.S.DIST(1.333333,FALSE)
"
,
"
A1
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
9
)
-
0
,
0.164010148
);
}
);
test
(
"
Test:
\"
NEGBINOMDIST
\"
"
,
function
()
{
function
negbinomdist
(
x
,
r
,
p
)
{
function
negbinomdist
(
x
,
r
,
p
)
{
x
=
parseInt
(
x
);
x
=
parseInt
(
x
);
...
...
cell/model/FormulaObjects/_xlfnFunctions.js
View file @
d8f526d7
...
@@ -55,10 +55,8 @@
...
@@ -55,10 +55,8 @@
cFormulaFunctionGroup
[
'
TextAndData
'
]
=
cFormulaFunctionGroup
[
'
TextAndData
'
]
||
[];
cFormulaFunctionGroup
[
'
TextAndData
'
]
=
cFormulaFunctionGroup
[
'
TextAndData
'
]
||
[];
cFormulaFunctionGroup
[
'
TextAndData
'
].
push
(
cDBCS
,
cUNICHAR
,
cUNICODE
);
cFormulaFunctionGroup
[
'
TextAndData
'
].
push
(
cDBCS
,
cUNICHAR
,
cUNICODE
);
cFormulaFunctionGroup
[
'
Statistical
'
]
=
cFormulaFunctionGroup
[
'
Statistical
'
]
||
[];
cFormulaFunctionGroup
[
'
Statistical
'
]
=
cFormulaFunctionGroup
[
'
Statistical
'
]
||
[];
cFormulaFunctionGroup
[
'
Statistical
'
].
push
(
cBINOM_DIST_RANGE
,
cFormulaFunctionGroup
[
'
Statistical
'
].
push
(
cBINOM_DIST_RANGE
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cHYPGEOM_DIST
,
cNEGBINOM_DIST
,
cPERMUTATIONA
,
cPHI
);
cHYPGEOM_DIST
,
cNEGBINOM_DIST
,
cNORM_S_DIST
,
cPERMUTATIONA
,
cPHI
);
cFormulaFunctionGroup
[
'
Financial
'
]
=
cFormulaFunctionGroup
[
'
Financial
'
]
||
[];
cFormulaFunctionGroup
[
'
Financial
'
]
=
cFormulaFunctionGroup
[
'
Financial
'
]
||
[];
cFormulaFunctionGroup
[
'
Financial
'
].
push
(
cPDURATION
,
cRRI
);
cFormulaFunctionGroup
[
'
Financial
'
].
push
(
cPDURATION
,
cRRI
);
cFormulaFunctionGroup
[
'
Mathematic
'
]
=
cFormulaFunctionGroup
[
'
Mathematic
'
]
||
[];
cFormulaFunctionGroup
[
'
Mathematic
'
]
=
cFormulaFunctionGroup
[
'
Mathematic
'
]
||
[];
...
@@ -71,9 +69,8 @@
...
@@ -71,9 +69,8 @@
cFormulaFunctionGroup
[
'
NotRealised
'
]
=
cFormulaFunctionGroup
[
'
NotRealised
'
]
||
[];
cFormulaFunctionGroup
[
'
NotRealised
'
]
=
cFormulaFunctionGroup
[
'
NotRealised
'
]
||
[];
cFormulaFunctionGroup
[
'
NotRealised
'
].
push
(
cDAYS
,
cISOWEEKNUM
,
cBITAND
,
cBITLSHIFT
,
cBITOR
,
cBITRSHIFT
,
cBITXOR
,
cFormulaFunctionGroup
[
'
NotRealised
'
].
push
(
cDAYS
,
cISOWEEKNUM
,
cBITAND
,
cBITLSHIFT
,
cBITOR
,
cBITRSHIFT
,
cBITXOR
,
cDBCS
,
cUNICHAR
,
cUNICODE
,
cBINOM_DIST_RANGE
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cDBCS
,
cUNICHAR
,
cUNICODE
,
cBINOM_DIST_RANGE
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cHYPGEOM_DIST
,
cNEGBINOM_DIST
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cHYPGEOM_DIST
,
cNEGBINOM_DIST
,
cPERMUTATIONA
,
cPHI
,
cPDURATION
,
cNORM_S_DIST
,
cPERMUTATIONA
,
cPHI
,
cPDURATION
,
cRRI
,
cAGGREGATE
,
cMUNIT
,
cFORMULATEXT
,
cISFORMULA
,
cRRI
,
cAGGREGATE
,
cMUNIT
,
cFORMULATEXT
,
cISFORMULA
,
cSHEET
,
cSHEETS
);
cSHEET
,
cSHEETS
);
/**
/**
* @constructor
* @constructor
...
@@ -339,18 +336,6 @@
...
@@ -339,18 +336,6 @@
cNEGBINOM_DIST
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cNEGBINOM_DIST
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cNEGBINOM_DIST
.
prototype
.
constructor
=
cNEGBINOM_DIST
;
cNEGBINOM_DIST
.
prototype
.
constructor
=
cNEGBINOM_DIST
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cNORM_S_DIST
()
{
cBaseFunction
.
call
(
this
,
"
NORM.S.DIST
"
);
this
.
isXLFN
=
true
;
}
cNORM_S_DIST
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cNORM_S_DIST
.
prototype
.
constructor
=
cNORM_S_DIST
;
/**
/**
* @constructor
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
* @extends {AscCommonExcel.cBaseFunction}
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
d8f526d7
...
@@ -68,8 +68,8 @@
...
@@ -68,8 +68,8 @@
cFORECAST_LINEAR
,
cFREQUENCY
,
cFTEST
,
cGAMMA
,
cGAMMA_DIST
,
cGAMMADIST
,
cGAMMA_INV
,
cGAMMAINV
,
cGAMMALN
,
cFORECAST_LINEAR
,
cFREQUENCY
,
cFTEST
,
cGAMMA
,
cGAMMA_DIST
,
cGAMMADIST
,
cGAMMA_INV
,
cGAMMAINV
,
cGAMMALN
,
cGAMMALN_PRECISE
,
cGAUSS
,
cGEOMEAN
,
cGROWTH
,
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cLINEST
,
cGAMMALN_PRECISE
,
cGAUSS
,
cGEOMEAN
,
cGROWTH
,
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cLINEST
,
cLOGEST
,
cLOGINV
,
cLOGNORM_DIST
,
cLOGNORM_INV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cLOGEST
,
cLOGINV
,
cLOGNORM_DIST
,
cLOGNORM_INV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cMODE_MULT
,
cMODE_SNGL
,
cNEGBINOMDIST
,
cNORMDIST
,
cNORM_DIST
,
cNORMINV
,
cNORM_INV
,
cNORMSDIST
,
cNORM
SINV
,
cMODE_MULT
,
cMODE_SNGL
,
cNEGBINOMDIST
,
cNORMDIST
,
cNORM_DIST
,
cNORMINV
,
cNORM_INV
,
cNORMSDIST
,
cNORM
_S_DIST
,
cNORM_S_INV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cPERCENTRANK
,
cPERCENTRANK_EXC
,
cNORM
SINV
,
cNORM
_S_INV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cPERCENTRANK
,
cPERCENTRANK_EXC
,
cPERCENTRANK_INC
,
cPERMUT
,
cPOISSON
,
cPOISSON_DIST
,
cPROB
,
cQUARTILE
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cRANK
,
cPERCENTRANK_INC
,
cPERMUT
,
cPOISSON
,
cPOISSON_DIST
,
cPROB
,
cQUARTILE
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cRANK
,
cRANK_AVG
,
cRANK_EQ
,
cRSQ
,
cSKEW
,
cSKEW_P
,
cSLOPE
,
cSMALL
,
cSTANDARDIZE
,
cSTDEV
,
cSTDEV_S
,
cSTDEVA
,
cSTDEVP
,
cRANK_AVG
,
cRANK_EQ
,
cRSQ
,
cSKEW
,
cSKEW_P
,
cSLOPE
,
cSMALL
,
cSTANDARDIZE
,
cSTDEV
,
cSTDEV_S
,
cSTDEVA
,
cSTDEVP
,
cSTDEV_P
,
cSTDEVPA
,
cSTEYX
,
cTDIST
,
cT_DIST
,
cT_DIST_2T
,
cT_DIST_RT
,
cT_INV
,
cT_INV_2T
,
cTINV
,
cTREND
,
cSTDEV_P
,
cSTDEVPA
,
cSTEYX
,
cTDIST
,
cT_DIST
,
cT_DIST_2T
,
cT_DIST_RT
,
cT_INV
,
cT_INV_2T
,
cTINV
,
cTREND
,
...
@@ -5569,6 +5569,50 @@
...
@@ -5569,6 +5569,50 @@
return
this
.
value
=
arg0
;
return
this
.
value
=
arg0
;
};
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cNORM_S_DIST
()
{
this
.
name
=
"
NORM.S.DIST
"
;
this
.
value
=
null
;
this
.
argumentsCurrent
=
0
;
}
cNORM_S_DIST
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cNORM_S_DIST
.
prototype
.
constructor
=
cNORM_S_DIST
;
cNORM_S_DIST
.
prototype
.
argumentsMin
=
2
;
cNORM_S_DIST
.
prototype
.
argumentsMax
=
2
;
cNORM_S_DIST
.
prototype
.
isXLFN
=
true
;
cNORM_S_DIST
.
prototype
.
numFormat
=
AscCommonExcel
.
cNumFormatNone
;
cNORM_S_DIST
.
prototype
.
Calculate
=
function
(
arg
)
{
function
normDistCalc
(
argArray
)
{
var
arg0
=
argArray
[
0
],
arg1
=
argArray
[
1
];
var
res
;
if
(
arg1
){
res
=
0.5
+
gauss
(
arg0
);
}
else
{
res
=
Math
.
exp
(
-
Math
.
pow
(
arg0
,
2
)
/
2
)
/
Math
.
sqrt
(
2
*
Math
.
PI
);
}
return
isNaN
(
res
)
?
new
cError
(
cErrorType
.
not_numeric
)
:
new
cNumber
(
res
);
}
var
oArguments
=
this
.
_prepareArguments
(
arg
,
arguments
[
1
],
true
);
var
argClone
=
oArguments
.
args
;
argClone
[
0
]
=
argClone
[
0
].
tocNumber
();
argClone
[
1
]
=
argClone
[
1
].
tocNumber
();
var
argError
;
if
(
argError
=
this
.
_checkErrorArg
(
argClone
))
{
return
this
.
value
=
argError
;
}
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
normDistCalc
);
};
/**
/**
* @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