Commit d4a02b35 authored by GoshaZotov's avatar GoshaZotov

add Z.TEST formula

parent e5d5c0b9
......@@ -1066,6 +1066,35 @@ $( function () {
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.273913, "2 * MIN(ZTEST(A2:A11,6), 1 - ZTEST(A2:A11,6))" );
} );
test( "Test: \"Z.TEST\"", function () {
ws.getRange2( "A2" ).setValue( "3" );
ws.getRange2( "A3" ).setValue( "6" );
ws.getRange2( "A4" ).setValue( "7" );
ws.getRange2( "A5" ).setValue( "8" );
ws.getRange2( "A6" ).setValue( "6" );
ws.getRange2( "A7" ).setValue( "5" );
ws.getRange2( "A8" ).setValue( "4" );
ws.getRange2( "A9" ).setValue( "2" );
ws.getRange2( "A10" ).setValue( "1" );
ws.getRange2( "A11" ).setValue( "9" );
oParser = new parserFormula( "Z.TEST(A2:A11,4)", "A1", ws );
ok( oParser.parse(), "Z.TEST(A2:A11,4)" );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.090574, "Z.TEST(A2:A11,4)" );
oParser = new parserFormula( "2 * MIN(Z.TEST(A2:A11,4), 1 - Z.TEST(A2:A11,4))", "A1", ws );
ok( oParser.parse(), "2 * MIN(Z.TEST(A2:A11,4), 1 - Z.TEST(A2:A11,4))" );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.181148, "2 * MIN(Z.TEST(A2:A11,4), 1 - Z.TEST(A2:A11,4))" );
oParser = new parserFormula( "Z.TEST(A2:A11,6)", "A1", ws );
ok( oParser.parse(), "Z.TEST(A2:A11,6)" );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.863043, "Z.TEST(A2:A11,6)" );
oParser = new parserFormula( "2 * MIN(Z.TEST(A2:A11,6), 1 - Z.TEST(A2:A11,6))", "A1", ws );
ok( oParser.parse(), "2 * MIN(Z.TEST(A2:A11,6), 1 - Z.TEST(A2:A11,6))" );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.273913, "2 * MIN(Z.TEST(A2:A11,6), 1 - Z.TEST(A2:A11,6))" );
} );
test( "Test: \"F.DIST\"", function () {
......
......@@ -59,7 +59,7 @@
cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT,
cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST, cNORM_INV, cNORM_S_DIST,
cNORM_S_INV, cPERMUTATIONA, cPHI, cSTDEV_P, cSTDEV_S,
cWEIBULL_DIST, cZ_TEST);
cWEIBULL_DIST);
cFormulaFunctionGroup['Financial'] = cFormulaFunctionGroup['Financial'] || [];
cFormulaFunctionGroup['Financial'].push(cPDURATION, cRRI);
cFormulaFunctionGroup['Mathematic'] = cFormulaFunctionGroup['Mathematic'] || [];
......@@ -75,7 +75,7 @@
cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY,
cFORECAST_ETS_STAT, cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST,
cNORM_INV, cNORM_S_DIST, cNORM_S_INV, cPERMUTATIONA, cPHI,
cSTDEV_P, cSTDEV_S, cWEIBULL_DIST, cZ_TEST, cPDURATION, cRRI, cAGGREGATE, cMUNIT,
cSTDEV_P, cSTDEV_S, cWEIBULL_DIST, cPDURATION, cRRI, cAGGREGATE, cMUNIT,
cFORMULATEXT, cISFORMULA, cSHEET, cSHEETS);
/**
......@@ -545,16 +545,4 @@
cWEIBULL_DIST.prototype = Object.create(cBaseFunction.prototype);
cWEIBULL_DIST.prototype.constructor = cWEIBULL_DIST;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cZ_TEST() {
cBaseFunction.call(this, "Z.TEST");
this.isXLFN = true;
}
cZ_TEST.prototype = Object.create(cBaseFunction.prototype);
cZ_TEST.prototype.constructor = cZ_TEST;
})(window);
......@@ -73,7 +73,7 @@
cPOISSON_DIST, cPROB, cQUARTILE, cQUARTILE_EXC, cQUARTILE_INC, cRANK, cRANK_AVG, cRANK_EQ, cRSQ, cSKEW, cSKEW_P,
cSLOPE, cSMALL, cSTANDARDIZE, cSTDEV, cSTDEVA, cSTDEVP, cSTDEVPA, cSTEYX, cTDIST, cT_DIST, cT_DIST_2T,
cT_DIST_RT, cT_INV, cT_INV_2T, cTINV, cTREND, cTRIMMEAN, cTTEST, cT_TEST, cVAR, cVARA, cVARP, cVAR_P, cVAR_S,
cVARPA, cWEIBULL, cZTEST);
cVARPA, cWEIBULL, cZTEST, cZ_TEST);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cFTEST, cGROWTH, cLINEST, cLOGEST, cTREND,
......@@ -8104,6 +8104,19 @@
return this.value = this._findArrayInNumberArguments(oArguments, calcZTest);
};
/**
* @constructor
* @extends {cZTEST}
*/
function cZ_TEST() {
cZTEST.call(this);
this.name = "Z.TEST";
}
cZ_TEST.prototype = Object.create(cZTEST.prototype);
cZ_TEST.prototype.constructor = cZ_TEST;
cZ_TEST.prototype.isXLFN = true;
//----------------------------------------------------------export----------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window['AscCommonExcel'].phi = phi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment