Commit 5a30935b authored by GoshaZotov's avatar GoshaZotov

add ERFC.PRECISE formula

parent 56b7e869
...@@ -7185,4 +7185,24 @@ $( function () { ...@@ -7185,4 +7185,24 @@ $( function () {
}); });
test( "Test: \"ERFC.PRECISE\"", function () {
oParser = new parserFormula( "ERFC.PRECISE(1.234)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(14)-0, 0.08096058304233157.toFixed(14)-0 );
oParser = new parserFormula( "ERFC.PRECISE(1)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(14)-0, 0.15729920705028513.toFixed(14)-0 );
oParser = new parserFormula( "ERFC.PRECISE(0)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 1 );
oParser = new parserFormula( "ERFC.PRECISE(-1)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(14)-0, 1.8427007929497148.toFixed(14)-0 );
});
} ); } );
...@@ -51,8 +51,7 @@ ...@@ -51,8 +51,7 @@
cFormulaFunctionGroup['DateAndTime'] = cFormulaFunctionGroup['DateAndTime'] || []; cFormulaFunctionGroup['DateAndTime'] = cFormulaFunctionGroup['DateAndTime'] || [];
cFormulaFunctionGroup['DateAndTime'].push(cDAYS, cISOWEEKNUM); cFormulaFunctionGroup['DateAndTime'].push(cDAYS, cISOWEEKNUM);
cFormulaFunctionGroup['Engineering'] = cFormulaFunctionGroup['Engineering'] || []; cFormulaFunctionGroup['Engineering'] = cFormulaFunctionGroup['Engineering'] || [];
cFormulaFunctionGroup['Engineering'].push(cBITAND, cBITLSHIFT, cBITOR, cBITRSHIFT, cBITXOR, cERF_PRECISE, cFormulaFunctionGroup['Engineering'].push(cBITAND, cBITLSHIFT, cBITOR, cBITRSHIFT, cBITXOR, cERF_PRECISE);
cERFC_PRECISE);
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'] || [];
...@@ -72,7 +71,7 @@ ...@@ -72,7 +71,7 @@
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,
cERF_PRECISE, cERFC_PRECISE, cDBCS, cUNICHAR, cUNICODE, cBINOM_DIST_RANGE, cCHISQ_TEST, cERF_PRECISE, cDBCS, cUNICHAR, cUNICODE, cBINOM_DIST_RANGE, cCHISQ_TEST,
cCOVARIANCE_P, cCOVARIANCE_S, cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cCOVARIANCE_P, cCOVARIANCE_S, 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,
...@@ -247,18 +246,6 @@ ...@@ -247,18 +246,6 @@
cERF_PRECISE.prototype = Object.create(cBaseFunction.prototype); cERF_PRECISE.prototype = Object.create(cBaseFunction.prototype);
cERF_PRECISE.prototype.constructor = cERF_PRECISE; cERF_PRECISE.prototype.constructor = cERF_PRECISE;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cERFC_PRECISE() {
cBaseFunction.call(this, "ERFC.PRECISE");
this.isXLFN = true;
}
cERFC_PRECISE.prototype = Object.create(cBaseFunction.prototype);
cERFC_PRECISE.prototype.constructor = cERFC_PRECISE;
/** /**
* @constructor * @constructor
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
......
...@@ -936,9 +936,10 @@ ...@@ -936,9 +936,10 @@
cFormulaFunctionGroup['Engineering'] = cFormulaFunctionGroup['Engineering'] || []; cFormulaFunctionGroup['Engineering'] = cFormulaFunctionGroup['Engineering'] || [];
cFormulaFunctionGroup['Engineering'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cBIN2DEC, cBIN2HEX, cBIN2OCT, cFormulaFunctionGroup['Engineering'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cBIN2DEC, cBIN2HEX, cBIN2OCT,
cCOMPLEX, cCONVERT, cDEC2BIN, cDEC2HEX, cDEC2OCT, cDELTA, cERF, cERFC, cGESTEP, cHEX2BIN, cHEX2DEC, cHEX2OCT, cCOMPLEX, cCONVERT, cDEC2BIN, cDEC2HEX, cDEC2OCT, cDELTA, cERF, cERFC, cERFC_PRECISE, cGESTEP, cHEX2BIN,
cIMABS, cIMAGINARY, cIMARGUMENT, cIMCONJUGATE, cIMCOS, cIMCOSH, cIMCOT, cIMCSC, cIMCSCH, cIMDIV, cIMEXP, cIMLN, cIMLOG10, cIMLOG2, cIMPOWER, cHEX2DEC, cHEX2OCT, cIMABS, cIMAGINARY, cIMARGUMENT, cIMCONJUGATE, cIMCOS, cIMCOSH, cIMCOT, cIMCSC, cIMCSCH,
cIMPRODUCT, cIMREAL, cIMSEC, cIMSECH, cIMSIN, cIMSINH, cIMSQRT, cIMSUB, cIMSUM, cIMTAN, cOCT2BIN, cOCT2DEC, cOCT2HEX); cIMDIV, cIMEXP, cIMLN, cIMLOG10, cIMLOG2, cIMPOWER, cIMPRODUCT, cIMREAL, cIMSEC, cIMSECH, cIMSIN, cIMSINH,
cIMSQRT, cIMSUB, cIMSUM, cIMTAN, cOCT2BIN, cOCT2DEC, cOCT2HEX);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || []; cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cCONVERT); cFormulaFunctionGroup['NotRealised'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cCONVERT);
...@@ -1592,6 +1593,19 @@ ...@@ -1592,6 +1593,19 @@
}; };
/**
* @constructor
* @extends {cERFC}
*/
function cERFC_PRECISE() {
cERFC.call(this);
this.name = "ERFC.PRECISE";
}
cERFC_PRECISE.prototype = Object.create(cERFC.prototype);
cERFC_PRECISE.prototype.constructor = cERFC_PRECISE;
cERFC_PRECISE.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