Commit 24c187f0 authored by GoshaZotov's avatar GoshaZotov

add GAUSS function

parent b6309a98
......@@ -1115,6 +1115,12 @@ $( function () {
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0500006, "CHIDIST(A2,A3)" );
} );
test( "Test: \"GAUSS\"", function () {
oParser = new parserFormula( "GAUSS(2)", "A1", ws );
ok( oParser.parse(), "GAUSS(2)" );
strictEqual( oParser.calculate().getValue().toFixed(5) - 0, 0.47725, "GAUSS(2)" );
} );
test( "Test: \"CHISQ.DIST.RT\"", function () {
ws.getRange2( "A2" ).setValue( "18.307" );
ws.getRange2( "A3" ).setValue( "10" );
......
......@@ -60,7 +60,7 @@
cCHISQ_DIST, cCHISQ_DIST_RT, cCHISQ_INV, cCHISQ_INV_RT, cCHISQ_TEST, cCONFIDENCE_NORM, cCONFIDENCE_T,
cCOVARIANCE_P, cCOVARIANCE_S, cEXPON_DIST, cF_DIST, cF_DIST_RT, cF_INV, cF_INV_RT, cF_TEST, cFORECAST_ETS,
cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT, cFORECAST_LINEAR, cGAMMA, cGAMMA_DIST,
cGAMMA_INV, cGAMMALN_PRECISE, cGAUSS, cHYPGEOM_DIST, cLOGNORM_DIST, cLOGNORM_INV, cMODE_MULT, cMODE_SNGL,
cGAMMA_INV, cGAMMALN_PRECISE, cHYPGEOM_DIST, cLOGNORM_DIST, cLOGNORM_INV, cMODE_MULT, cMODE_SNGL,
cNEGBINOM_DIST, cNORM_DIST, cNORM_INV, cNORM_S_DIST, cNORM_S_INV, cPERCENTILE_EXC, cPERCENTILE_INC,
cPERCENTRANK_EXC, cPERCENTRANK_INC, cPERMUTATIONA, cPHI, cPOISSON_DIST, cQUARTILE_EXC, cQUARTILE_INC, cRANK_AVG,
cRANK_EQ, cSKEW_P, cSTDEV_P, cSTDEV_S, cT_DIST, cT_DIST_2T, cT_DIST_RT, cT_INV, cT_INV_2T, cT_TEST, cVAR_P,
......@@ -578,18 +578,6 @@
cGAMMALN_PRECISE.prototype = Object.create(cBaseFunction.prototype);
cGAMMALN_PRECISE.prototype.constructor = cGAMMALN_PRECISE;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cGAUSS() {
cBaseFunction.call(this, "GAUSS");
this.isXLFN = true;
}
cGAUSS.prototype = Object.create(cBaseFunction.prototype);
cGAUSS.prototype.constructor = cGAUSS;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
......@@ -63,7 +63,7 @@
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,
cCOUNTIFS, cCOVAR, cCRITBINOM, cDEVSQ, cEXPONDIST, cFDIST, cF_DIST, cF_DIST_RT, cF_INV, cF_INV_RT, cFINV, 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, cGAUSS, cGEOMEAN, cGROWTH, cHARMEAN, cHYPGEOMDIST, cINTERCEPT, cKURT, cLARGE,
cLINEST, cLOGEST, cLOGINV, cLOGNORM_DIST, cLOGNORM_INV, cLOGNORMDIST, cMAX, cMAXA, cMEDIAN, cMIN, cMINA, cMODE, cNEGBINOMDIST, cNORMDIST,
cNORMINV, cNORMSDIST, cNORMSINV, cPEARSON, cPERCENTILE, cPERCENTRANK, cPERMUT, cPOISSON, cPROB, cQUARTILE,
cRANK, cRSQ, cSKEW, cSLOPE, cSMALL, cSTANDARDIZE, cSTDEV, cSTDEVA, cSTDEVP, cSTDEVPA, cSTEYX, cTDIST, cT_DIST,
......@@ -3612,6 +3612,43 @@
return {name: this.name, args: "(number)"}
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cGAUSS() {
this.name = "GAUSS";
this.value = null;
this.argumentsCurrent = 0;
}
cGAUSS.prototype = Object.create(cBaseFunction.prototype);
cGAUSS.prototype.constructor = cGAUSS;
cGAUSS.prototype.argumentsMin = 1;
cGAUSS.prototype.argumentsMax = 1;
cGAUSS.prototype.isXLFN = true;
cGAUSS.prototype.Calculate = function (arg) {
var oArguments = this._prepareArguments(arg, arguments[1], true);
var argClone = oArguments.args;
argClone[0] = argClone[0].tocNumber();
var argError;
if (argError = this._checkErrorArg(argClone)) {
return this.value = argError;
}
var calcGauss = function(argArray) {
var res = gauss(argArray[0]);
return isNaN(res) ? new cError(cErrorType.not_numeric) : new cNumber(res);
};
return this.value = this._findArrayInNumberArguments(oArguments, calcGauss);
};
cGAUSS.prototype.getInfo = function () {
return {name: this.name, args: "(number)"}//в документации аргумент называется Z
};
/**
* @constructor
* @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