Commit 122b51c1 authored by GoshaZotov's avatar GoshaZotov

add WEIBULL.DIST formula

parent f17aa2b8
...@@ -2470,6 +2470,21 @@ $( function () { ...@@ -2470,6 +2470,21 @@ $( function () {
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.035589 ); strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.035589 );
} ); } );
test( "Test: \"WEIBULL.DIST\"", function () {
ws.getRange2( "A2" ).setValue( "105" );
ws.getRange2( "A3" ).setValue( "20" );
ws.getRange2( "A4" ).setValue( "100" );
oParser = new parserFormula( "WEIBULL.DIST(A2,A3,A4,TRUE)", "A20", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.929581 );
oParser = new parserFormula( "WEIBULL.DIST(A2,A3,A4,FALSE)", "A20", ws );
ok( oParser.parse(), "WEIBULL.DIST(A2,A3,A4,FALSE)" );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.035589 );
} );
test( "Test: \"YEARFRAC\"", function () { test( "Test: \"YEARFRAC\"", function () {
function okWrapper( a, b ) { function okWrapper( a, b ) {
ok( Math.abs( a - b ) < dif ); ok( Math.abs( a - b ) < dif );
......
...@@ -58,8 +58,7 @@ ...@@ -58,8 +58,7 @@
cFormulaFunctionGroup['Statistical'].push(cBINOM_DIST_RANGE, cFormulaFunctionGroup['Statistical'].push(cBINOM_DIST_RANGE,
cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT, cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT,
cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST, cNORM_INV, cNORM_S_DIST, cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST, cNORM_INV, cNORM_S_DIST,
cNORM_S_INV, cPERMUTATIONA, cPHI, cSTDEV_P, cSTDEV_S, cNORM_S_INV, cPERMUTATIONA, cPHI, cSTDEV_P, cSTDEV_S);
cWEIBULL_DIST);
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'] || [];
...@@ -75,7 +74,7 @@ ...@@ -75,7 +74,7 @@
cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY,
cFORECAST_ETS_STAT, cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST, cFORECAST_ETS_STAT, cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST,
cNORM_INV, cNORM_S_DIST, cNORM_S_INV, cPERMUTATIONA, cPHI, cNORM_INV, cNORM_S_DIST, cNORM_S_INV, cPERMUTATIONA, cPHI,
cSTDEV_P, cSTDEV_S, cWEIBULL_DIST, cPDURATION, cRRI, cAGGREGATE, cMUNIT, cSTDEV_P, cSTDEV_S, cPDURATION, cRRI, cAGGREGATE, cMUNIT,
cFORMULATEXT, cISFORMULA, cSHEET, cSHEETS); cFORMULATEXT, cISFORMULA, cSHEET, cSHEETS);
/** /**
...@@ -533,16 +532,4 @@ ...@@ -533,16 +532,4 @@
cWEBSERVICE.prototype = Object.create(cBaseFunction.prototype); cWEBSERVICE.prototype = Object.create(cBaseFunction.prototype);
cWEBSERVICE.prototype.constructor = cWEBSERVICE; cWEBSERVICE.prototype.constructor = cWEBSERVICE;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cWEIBULL_DIST() {
cBaseFunction.call(this, "WEIBULL.DIST");
this.isXLFN = true;
}
cWEIBULL_DIST.prototype = Object.create(cBaseFunction.prototype);
cWEIBULL_DIST.prototype.constructor = cWEIBULL_DIST;
})(window); })(window);
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
cPOISSON_DIST, cPROB, cQUARTILE, cQUARTILE_EXC, cQUARTILE_INC, cRANK, cRANK_AVG, cRANK_EQ, cRSQ, cSKEW, cSKEW_P, 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, 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, cT_DIST_RT, cT_INV, cT_INV_2T, cTINV, cTREND, cTRIMMEAN, cTTEST, cT_TEST, cVAR, cVARA, cVARP, cVAR_P, cVAR_S,
cVARPA, cWEIBULL, cZTEST, cZ_TEST); cVARPA, cWEIBULL, cWEIBULL_DIST, cZTEST, cZ_TEST);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || []; cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cFTEST, cGROWTH, cLINEST, cLOGEST, cTREND); cFormulaFunctionGroup['NotRealised'].push(cFTEST, cGROWTH, cLINEST, cLOGEST, cTREND);
...@@ -8120,6 +8120,19 @@ ...@@ -8120,6 +8120,19 @@
return this.value = this._findArrayInNumberArguments(oArguments, calcWeibull); return this.value = this._findArrayInNumberArguments(oArguments, calcWeibull);
}; };
/**
* @constructor
* @extends {cRANK}
*/
function cWEIBULL_DIST() {
cWEIBULL.call(this);
this.name = "WEIBULL.DIST";
}
cWEIBULL_DIST.prototype = Object.create(cWEIBULL.prototype);
cWEIBULL_DIST.prototype.constructor = cWEIBULL_DIST;
cWEIBULL_DIST.prototype.isXLFN = true;
/** /**
* @constructor * @constructor
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
......
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