Commit 6c91fe35 authored by Alexander.Trofimov's avatar Alexander.Trofimov

delete this.name from formulas classes -> move to prototype

parent 639ab89f
......@@ -37,7 +37,7 @@
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
function (window, undefined) {
var cErrorType = AscCommonExcel.cErrorType;
var cNumber = AscCommonExcel.cNumber;
var cString = AscCommonExcel.cString;
......@@ -202,13 +202,13 @@
if (fNum <= 2) {
y = fNum * fNum / 4.0;
fRet = (-Math.log(fNum / 2.0) * BesselI(fNum, 0)) + (-0.57721566 + y * (0.42278420 +
y * (0.23069756 + y * (0.3488590e-1 + y * (0.262698e-2 + y * (0.10750e-3 + y * 0.74e-5))))));
fRet = (-Math.log(fNum / 2.0) * BesselI(fNum, 0)) + (-0.57721566 + y * (0.42278420 + y *
(0.23069756 + y * (0.3488590e-1 + y * (0.262698e-2 + y * (0.10750e-3 + y * 0.74e-5))))));
} else {
y = 2 / fNum;
fRet = Math.exp(-fNum) / Math.sqrt(fNum) * ( 1.25331414 + y * ( -0.7832358e-1 + y * ( 0.2189568e-1 +
y * ( -0.1062446e-1 + y * ( 0.587872e-2 + y * ( -0.251540e-2 + y * 0.53208e-3 ) ) ) ) ) );
fRet = Math.exp(-fNum) / Math.sqrt(fNum) * ( 1.25331414 + y * ( -0.7832358e-1 + y * ( 0.2189568e-1 + y *
( -0.1062446e-1 + y * ( 0.587872e-2 + y * ( -0.251540e-2 + y * 0.53208e-3 ) ) ) ) ) );
}
return new cNumber(fRet);
......@@ -219,12 +219,12 @@
if (fNum <= 2) {
y = fNum * fNum / 4.0;
fRet = (Math.log(fNum / 2.0) * BesselI(fNum, 1)) + (1.0 / fNum) * (1.0 + y * (0.15443144 +
y * (-0.67278579 + y * (-0.18156897 + y * (-0.1919402e-1 + y * (-0.110404e-2 + y * (-0.4686e-4)))))));
fRet = (Math.log(fNum / 2.0) * BesselI(fNum, 1)) + (1.0 / fNum) * (1.0 + y * (0.15443144 + y *
(-0.67278579 + y * (-0.18156897 + y * (-0.1919402e-1 + y * (-0.110404e-2 + y * (-0.4686e-4)))))));
} else {
y = 2 / fNum;
fRet = Math.exp(-fNum) / Math.sqrt(fNum) * ( 1.25331414 + y * ( 0.23498619 + y * ( -0.3655620e-1 +
y * ( 0.1504268e-1 + y * ( -0.780353e-2 + y * ( 0.325614e-2 + y * ( -0.68245e-3 ) ) ) ) ) ) );
fRet = Math.exp(-fNum) / Math.sqrt(fNum) * ( 1.25331414 + y * ( 0.23498619 + y * ( -0.3655620e-1 + y *
( 0.1504268e-1 + y * ( -0.780353e-2 + y * ( 0.325614e-2 + y * ( -0.68245e-3 ) ) ) ) ) ) );
}
return new cNumber(fRet);
......@@ -241,8 +241,8 @@
} else {
y = 3.75 / ax;
fRet = (Math.exp(ax) / Math.sqrt(ax)) * (0.39894228 + y * (0.1328592e-1 + y * (0.225319e-2 + y *
(-0.157565e-2 + y *
(0.916281e-2 + y * (-0.2057706e-1 + y * (0.2635537e-1 + y * (-0.1647633e-1 + y * 0.392377e-2))))))));
(-0.157565e-2 + y * (0.916281e-2 + y *
(-0.2057706e-1 + y * (0.2635537e-1 + y * (-0.1647633e-1 + y * 0.392377e-2))))))));
}
return fRet;
}
......@@ -402,8 +402,8 @@
if (fNum < 8.0) {
var y = (fNum * fNum);
var f1 = -2957821389.0 +
y * (7062834065.0 + y * (-512359803.6 + y * (10879881.29 + y * (-86327.92757 + y * 228.4622733))));
var f1 = -2957821389.0 + y *
(7062834065.0 + y * (-512359803.6 + y * (10879881.29 + y * (-86327.92757 + y * 228.4622733))));
var f2 = 40076544269.0 + y * (745249964.8 + y * (7189466.438 + y * (47447.26470 + y * (226.1030244 + y))));
var fRet = f1 / f2 + 0.636619772 * BesselJ(fNum, 0) * Math.log(fNum);
} else {
......@@ -411,8 +411,8 @@
var y = (z * z);
var xx = fNum - 0.785398164;
var f1 = 1 + y * (-0.1098628627e-2 + y * (0.2734510407e-4 + y * (-0.2073370639e-5 + y * 0.2093887211e-6)));
var f2 = -0.1562499995e-1 +
y * (0.1430488765e-3 + y * (-0.6911147651e-5 + y * (0.7621095161e-6 + y * (-0.934945152e-7))));
var f2 = -0.1562499995e-1 + y *
(0.1430488765e-3 + y * (-0.6911147651e-5 + y * (0.7621095161e-6 + y * (-0.934945152e-7))));
var fRet = Math.sqrt(0.636619772 / fNum) * (Math.sin(xx) * f1 + z * Math.cos(xx) * f2);
}
......@@ -424,18 +424,18 @@
var z, xx, y, fRet, ans1, ans2;
if (fNum < 8.0) {
y = fNum * fNum;
ans1 = fNum * (-0.4900604943e13 + y * (0.1275274390e13 +
y * (-0.5153438139e11 + y * (0.7349264551e9 + y * (-0.4237922726e7 + y * 0.8511937935e4)))));
ans2 = 0.2499580570e14 + y * (0.4244419664e12 +
y * (0.3733650367e10 + y * (0.2245904002e8 + y * (0.1020426050e6 + y * (0.3549632885e3 + y)))));
ans1 = fNum * (-0.4900604943e13 + y * (0.1275274390e13 + y *
(-0.5153438139e11 + y * (0.7349264551e9 + y * (-0.4237922726e7 + y * 0.8511937935e4)))));
ans2 = 0.2499580570e14 + y * (0.4244419664e12 + y *
(0.3733650367e10 + y * (0.2245904002e8 + y * (0.1020426050e6 + y * (0.3549632885e3 + y)))));
fRet = (ans1 / ans2) + 0.636619772 * (BesselJ(fNum) * Math.log(fNum) - 1.0 / fNum);
} else {
z = 8.0 / fNum;
y = z * z;
xx = fNum - 2.356194491;
ans1 = 1.0 + y * (0.183105e-2 + y * (-0.3516396496e-4 + y * (0.2457520174e-5 + y * (-0.240337019e-6))));
ans2 = 0.04687499995 +
y * (-0.2002690873e-3 + y * (0.8449199096e-5 + y * (-0.88228987e-6 + y * 0.105787412e-6)));
ans2 = 0.04687499995 + y *
(-0.2002690873e-3 + y * (0.8449199096e-5 + y * (-0.88228987e-6 + y * 0.105787412e-6)));
fRet = Math.sqrt(0.636619772 / fNum) * (Math.sin(xx) * ans1 + z * Math.cos(xx) * ans2);
}
......@@ -4342,11 +4342,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBESSELI() {
cBaseFunction.call(this, "BESSELI");
this.value = null;
this.argumentsCurrent = 0;
}
cBESSELI.prototype = Object.create(cBaseFunction.prototype);
cBESSELI.prototype.constructor = cBESSELI;
cBESSELI.prototype.name = 'BESSELI';
cBESSELI.prototype.argumentsMin = 2;
cBESSELI.prototype.argumentsMax = 2;
cBESSELI.prototype.Calculate = function (arg) {
......@@ -4384,11 +4386,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBESSELJ() {
cBaseFunction.call(this, "BESSELJ");
this.value = null;
this.argumentsCurrent = 0;
}
cBESSELJ.prototype = Object.create(cBaseFunction.prototype);
cBESSELJ.prototype.constructor = cBESSELJ;
cBESSELJ.prototype.name = 'BESSELJ';
cBESSELJ.prototype.argumentsMin = 2;
cBESSELJ.prototype.argumentsMax = 2;
cBESSELJ.prototype.Calculate = function (arg) {
......@@ -4428,11 +4432,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBESSELK() {
cBaseFunction.call(this, "BESSELK");
this.value = null;
this.argumentsCurrent = 0;
}
cBESSELK.prototype = Object.create(cBaseFunction.prototype);
cBESSELK.prototype.constructor = cBESSELK;
cBESSELK.prototype.name = 'BESSELK';
cBESSELK.prototype.argumentsMin = 2;
cBESSELK.prototype.argumentsMax = 2;
cBESSELK.prototype.Calculate = function (arg) {
......@@ -4470,11 +4476,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBESSELY() {
cBaseFunction.call(this, "BESSELY");
this.value = null;
this.argumentsCurrent = 0;
}
cBESSELY.prototype = Object.create(cBaseFunction.prototype);
cBESSELY.prototype.constructor = cBESSELY;
cBESSELY.prototype.name = 'BESSELY';
cBESSELY.prototype.argumentsMin = 2;
cBESSELY.prototype.argumentsMax = 2;
cBESSELY.prototype.Calculate = function (arg) {
......@@ -4512,11 +4520,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBIN2DEC() {
cBaseFunction.call(this, "BIN2DEC");
this.value = null;
this.argumentsCurrent = 0;
}
cBIN2DEC.prototype = Object.create(cBaseFunction.prototype);
cBIN2DEC.prototype.constructor = cBIN2DEC;
cBIN2DEC.prototype.name = 'BIN2DEC';
cBIN2DEC.prototype.argumentsMin = 1;
cBIN2DEC.prototype.argumentsMax = 1;
cBIN2DEC.prototype.Calculate = function (arg) {
......@@ -4560,11 +4570,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBIN2HEX() {
cBaseFunction.call(this, "BIN2HEX");
this.value = null;
this.argumentsCurrent = 0;
}
cBIN2HEX.prototype = Object.create(cBaseFunction.prototype);
cBIN2HEX.prototype.constructor = cBIN2HEX;
cBIN2HEX.prototype.name = 'BIN2HEX';
cBIN2HEX.prototype.argumentsMin = 1;
cBIN2HEX.prototype.argumentsMax = 2;
cBIN2HEX.prototype.Calculate = function (arg) {
......@@ -4624,11 +4636,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBIN2OCT() {
cBaseFunction.call(this, "BIN2OCT");
this.value = null;
this.argumentsCurrent = 0;
}
cBIN2OCT.prototype = Object.create(cBaseFunction.prototype);
cBIN2OCT.prototype.constructor = cBIN2OCT;
cBIN2OCT.prototype.name = 'BIN2OCT';
cBIN2OCT.prototype.argumentsMin = 1;
cBIN2OCT.prototype.argumentsMax = 2;
cBIN2OCT.prototype.Calculate = function (arg) {
......@@ -4688,11 +4702,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBITAND() {
cBaseFunction.call(this, "BITAND");
this.value = null;
this.argumentsCurrent = 0;
}
cBITAND.prototype = Object.create(cBaseFunction.prototype);
cBITAND.prototype.constructor = cBITAND;
cBITAND.prototype.name = 'BITAND';
cBITAND.prototype.argumentsMin = 2;
cBITAND.prototype.argumentsMax = 2;
cBITAND.prototype.isXLFN = true;
......@@ -4728,11 +4744,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBITLSHIFT() {
cBaseFunction.call(this, "BITLSHIFT");
this.value = null;
this.argumentsCurrent = 0;
}
cBITLSHIFT.prototype = Object.create(cBaseFunction.prototype);
cBITLSHIFT.prototype.constructor = cBITLSHIFT;
cBITLSHIFT.prototype.name = 'BITLSHIFT';
cBITLSHIFT.prototype.argumentsMin = 2;
cBITLSHIFT.prototype.argumentsMax = 2;
cBITLSHIFT.prototype.isXLFN = true;
......@@ -4776,11 +4794,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBITOR() {
cBaseFunction.call(this, "BITOR");
this.value = null;
this.argumentsCurrent = 0;
}
cBITOR.prototype = Object.create(cBaseFunction.prototype);
cBITOR.prototype.constructor = cBITOR;
cBITOR.prototype.name = 'BITOR';
cBITOR.prototype.argumentsMin = 2;
cBITOR.prototype.argumentsMax = 2;
cBITOR.prototype.isXLFN = true;
......@@ -4816,11 +4836,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBITRSHIFT() {
cBaseFunction.call(this, "BITRSHIFT");
this.value = null;
this.argumentsCurrent = 0;
}
cBITRSHIFT.prototype = Object.create(cBaseFunction.prototype);
cBITRSHIFT.prototype.constructor = cBITRSHIFT;
cBITRSHIFT.prototype.name = 'BITRSHIFT';
cBITRSHIFT.prototype.argumentsMin = 2;
cBITRSHIFT.prototype.argumentsMax = 2;
cBITRSHIFT.prototype.isXLFN = true;
......@@ -4864,11 +4886,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBITXOR() {
cBaseFunction.call(this, "BITXOR");
this.value = null;
this.argumentsCurrent = 0;
}
cBITXOR.prototype = Object.create(cBaseFunction.prototype);
cBITXOR.prototype.constructor = cBITXOR;
cBITXOR.prototype.name = 'BITXOR';
cBITXOR.prototype.argumentsMin = 2;
cBITXOR.prototype.argumentsMax = 2;
cBITXOR.prototype.isXLFN = true;
......@@ -4904,11 +4928,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cCOMPLEX() {
cBaseFunction.call(this, "COMPLEX");
this.value = null;
this.argumentsCurrent = 0;
}
cCOMPLEX.prototype = Object.create(cBaseFunction.prototype);
cCOMPLEX.prototype.constructor = cCOMPLEX;
cCOMPLEX.prototype.name = 'COMPLEX';
cCOMPLEX.prototype.argumentsMin = 2;
cCOMPLEX.prototype.argumentsMax = 3;
cCOMPLEX.prototype.Calculate = function (arg) {
......@@ -4968,11 +4994,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cCONVERT() {
cBaseFunction.call(this, "CONVERT");
this.value = null;
this.argumentsCurrent = 0;
}
cCONVERT.prototype = Object.create(cBaseFunction.prototype);
cCONVERT.prototype.constructor = cCONVERT;
cCONVERT.prototype.name = 'CONVERT';
cCONVERT.prototype.argumentsMin = 3;
cCONVERT.prototype.argumentsMax = 3;
cCONVERT.prototype.Calculate = function (arg) {
......@@ -5085,11 +5113,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cDEC2BIN() {
cBaseFunction.call(this, "DEC2BIN");
this.value = null;
this.argumentsCurrent = 0;
}
cDEC2BIN.prototype = Object.create(cBaseFunction.prototype);
cDEC2BIN.prototype.constructor = cDEC2BIN;
cDEC2BIN.prototype.name = 'DEC2BIN';
cDEC2BIN.prototype.argumentsMin = 1;
cDEC2BIN.prototype.argumentsMax = 2;
cDEC2BIN.prototype.Calculate = function (arg) {
......@@ -5144,11 +5174,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cDEC2HEX() {
cBaseFunction.call(this, "DEC2HEX");
this.value = null;
this.argumentsCurrent = 0;
}
cDEC2HEX.prototype = Object.create(cBaseFunction.prototype);
cDEC2HEX.prototype.constructor = cDEC2HEX;
cDEC2HEX.prototype.name = 'DEC2HEX';
cDEC2HEX.prototype.argumentsMin = 1;
cDEC2HEX.prototype.argumentsMax = 2;
cDEC2HEX.prototype.Calculate = function (arg) {
......@@ -5202,11 +5234,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cDEC2OCT() {
cBaseFunction.call(this, "DEC2OCT");
this.value = null;
this.argumentsCurrent = 0;
}
cDEC2OCT.prototype = Object.create(cBaseFunction.prototype);
cDEC2OCT.prototype.constructor = cDEC2OCT;
cDEC2OCT.prototype.name = 'DEC2OCT';
cDEC2OCT.prototype.argumentsMin = 1;
cDEC2OCT.prototype.argumentsMax = 2;
cDEC2OCT.prototype.Calculate = function (arg) {
......@@ -5260,11 +5294,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cDELTA() {
cBaseFunction.call(this, "DELTA");
this.value = null;
this.argumentsCurrent = 0;
}
cDELTA.prototype = Object.create(cBaseFunction.prototype);
cDELTA.prototype.constructor = cDELTA;
cDELTA.prototype.name = 'DELTA';
cDELTA.prototype.argumentsMin = 1;
cDELTA.prototype.argumentsMax = 2;
cDELTA.prototype.Calculate = function (arg) {
......@@ -5307,11 +5343,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cERF() {
cBaseFunction.call(this, "ERF");
this.value = null;
this.argumentsCurrent = 0;
}
cERF.prototype = Object.create(cBaseFunction.prototype);
cERF.prototype.constructor = cERF;
cERF.prototype.name = 'ERF';
cERF.prototype.argumentsMin = 1;
cERF.prototype.argumentsMax = 2;
cERF.prototype.Calculate = function (arg) {
......@@ -5349,11 +5387,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cERF_PRECISE() {
cBaseFunction.call(this, "ERF.PRECISE");
this.value = null;
this.argumentsCurrent = 0;
}
cERF_PRECISE.prototype = Object.create(cBaseFunction.prototype);
cERF_PRECISE.prototype.constructor = cERF_PRECISE;
cERF_PRECISE.prototype.name = 'ERF.PRECISE';
cERF_PRECISE.prototype.argumentsMin = 1;
cERF_PRECISE.prototype.argumentsMax = 1;
cERF_PRECISE.prototype.isXLFN = true;
......@@ -5382,11 +5422,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cERFC() {
cBaseFunction.call(this, "ERFC");
this.value = null;
this.argumentsCurrent = 0;
}
cERFC.prototype = Object.create(cBaseFunction.prototype);
cERFC.prototype.constructor = cERFC;
cERFC.prototype.name = 'ERFC';
cERFC.prototype.argumentsMin = 1;
cERFC.prototype.argumentsMax = 1;
cERFC.prototype.Calculate = function (arg) {
......@@ -6094,11 +6136,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMDIV() {
cBaseFunction.call(this, "IMDIV");
this.value = null;
this.argumentsCurrent = 0;
}
cIMDIV.prototype = Object.create(cBaseFunction.prototype);
cIMDIV.prototype.constructor = cIMDIV;
cIMDIV.prototype.name = 'IMDIV';
cIMDIV.prototype.argumentsMin = 2;
cIMDIV.prototype.argumentsMax = 2;
cIMDIV.prototype.Calculate = function (arg) {
......@@ -6147,11 +6191,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMEXP() {
cBaseFunction.call(this, "IMEXP");
this.value = null;
this.argumentsCurrent = 0;
}
cIMEXP.prototype = Object.create(cBaseFunction.prototype);
cIMEXP.prototype.constructor = cIMEXP;
cIMEXP.prototype.name = 'IMEXP';
cIMEXP.prototype.argumentsMin = 1;
cIMEXP.prototype.argumentsMax = 1;
cIMEXP.prototype.Calculate = function (arg) {
......@@ -6189,11 +6235,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMLN() {
cBaseFunction.call(this, "IMLN");
this.value = null;
this.argumentsCurrent = 0;
}
cIMLN.prototype = Object.create(cBaseFunction.prototype);
cIMLN.prototype.constructor = cIMLN;
cIMLN.prototype.name = 'IMLN';
cIMLN.prototype.argumentsMin = 1;
cIMLN.prototype.argumentsMax = 1;
cIMLN.prototype.Calculate = function (arg) {
......@@ -6235,11 +6283,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMLOG10() {
cBaseFunction.call(this, "IMLOG10");
this.value = null;
this.argumentsCurrent = 0;
}
cIMLOG10.prototype = Object.create(cBaseFunction.prototype);
cIMLOG10.prototype.constructor = cIMLOG10;
cIMLOG10.prototype.name = 'IMLOG10';
cIMLOG10.prototype.argumentsMin = 1;
cIMLOG10.prototype.argumentsMax = 1;
cIMLOG10.prototype.Calculate = function (arg) {
......@@ -6281,11 +6331,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMLOG2() {
cBaseFunction.call(this, "IMLOG2");
this.value = null;
this.argumentsCurrent = 0;
}
cIMLOG2.prototype = Object.create(cBaseFunction.prototype);
cIMLOG2.prototype.constructor = cIMLOG2;
cIMLOG2.prototype.name = 'IMLOG2';
cIMLOG2.prototype.argumentsMin = 1;
cIMLOG2.prototype.argumentsMax = 1;
cIMLOG2.prototype.Calculate = function (arg) {
......@@ -6327,11 +6379,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMPOWER() {
cBaseFunction.call(this, "IMPOWER");
this.value = null;
this.argumentsCurrent = 0;
}
cIMPOWER.prototype = Object.create(cBaseFunction.prototype);
cIMPOWER.prototype.constructor = cIMPOWER;
cIMPOWER.prototype.name = 'IMPOWER';
cIMPOWER.prototype.argumentsMin = 2;
cIMPOWER.prototype.argumentsMax = 2;
cIMPOWER.prototype.Calculate = function (arg) {
......@@ -6383,11 +6437,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMPRODUCT() {
cBaseFunction.call(this, "IMPRODUCT");
this.value = null;
this.argumentsCurrent = 0;
}
cIMPRODUCT.prototype = Object.create(cBaseFunction.prototype);
cIMPRODUCT.prototype.constructor = cIMPRODUCT;
cIMPRODUCT.prototype.name = 'IMPRODUCT';
cIMPRODUCT.prototype.argumentsMin = 1;
cIMPRODUCT.prototype.Calculate = function (arg) {
var arg0 = arg[0], t = this;
......@@ -6480,11 +6536,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMREAL() {
cBaseFunction.call(this, "IMREAL");
this.value = null;
this.argumentsCurrent = 0;
}
cIMREAL.prototype = Object.create(cBaseFunction.prototype);
cIMREAL.prototype.constructor = cIMREAL;
cIMREAL.prototype.name = 'IMREAL';
cIMREAL.prototype.argumentsMin = 1;
cIMREAL.prototype.argumentsMax = 1;
cIMREAL.prototype.Calculate = function (arg) {
......@@ -6520,11 +6578,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSEC() {
cBaseFunction.call(this, "IMSEC");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSEC.prototype = Object.create(cBaseFunction.prototype);
cIMSEC.prototype.constructor = cIMSEC;
cIMSEC.prototype.name = 'IMSEC';
cIMSEC.prototype.argumentsMin = 1;
cIMSEC.prototype.argumentsMax = 1;
cIMSEC.prototype.isXLFN = true;
......@@ -6567,11 +6627,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSECH() {
cBaseFunction.call(this, "IMSECH");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSECH.prototype = Object.create(cBaseFunction.prototype);
cIMSECH.prototype.constructor = cIMSECH;
cIMSECH.prototype.name = 'IMSECH';
cIMSECH.prototype.argumentsMin = 1;
cIMSECH.prototype.argumentsMax = 1;
cIMSECH.prototype.isXLFN = true;
......@@ -6615,11 +6677,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSIN() {
cBaseFunction.call(this, "IMSIN");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSIN.prototype = Object.create(cBaseFunction.prototype);
cIMSIN.prototype.constructor = cIMSIN;
cIMSIN.prototype.name = 'IMSIN';
cIMSIN.prototype.argumentsMin = 1;
cIMSIN.prototype.argumentsMax = 1;
cIMSIN.prototype.Calculate = function (arg) {
......@@ -6661,11 +6725,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSINH() {
cBaseFunction.call(this, "IMSINH");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSINH.prototype = Object.create(cBaseFunction.prototype);
cIMSINH.prototype.constructor = cIMSINH;
cIMSINH.prototype.name = 'IMSINH';
cIMSINH.prototype.argumentsMin = 1;
cIMSINH.prototype.argumentsMax = 1;
cIMSINH.prototype.isXLFN = true;
......@@ -6708,11 +6774,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSQRT() {
cBaseFunction.call(this, "IMSQRT");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSQRT.prototype = Object.create(cBaseFunction.prototype);
cIMSQRT.prototype.constructor = cIMSQRT;
cIMSQRT.prototype.name = 'IMSQRT';
cIMSQRT.prototype.argumentsMin = 1;
cIMSQRT.prototype.argumentsMax = 1;
cIMSQRT.prototype.Calculate = function (arg) {
......@@ -6750,11 +6818,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSUB() {
cBaseFunction.call(this, "IMSUB");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSUB.prototype = Object.create(cBaseFunction.prototype);
cIMSUB.prototype.constructor = cIMSUB;
cIMSUB.prototype.name = 'IMSUB';
cIMSUB.prototype.argumentsMin = 2;
cIMSUB.prototype.argumentsMax = 2;
cIMSUB.prototype.Calculate = function (arg) {
......@@ -6803,11 +6873,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMSUM() {
cBaseFunction.call(this, "IMSUM");
this.value = null;
this.argumentsCurrent = 0;
}
cIMSUM.prototype = Object.create(cBaseFunction.prototype);
cIMSUM.prototype.constructor = cIMSUM;
cIMSUM.prototype.name = 'IMSUM';
cIMSUM.prototype.argumentsMin = 1;
cIMSUM.prototype.Calculate = function (arg) {
......@@ -6901,12 +6973,14 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMTAN() {
cBaseFunction.call(this, "IMTAN");
this.value = null;
this.argumentsCurrent = 0;
}
//TODO проверить!!!
cIMTAN.prototype = Object.create(cBaseFunction.prototype);
cIMTAN.prototype.constructor = cIMTAN;
cIMTAN.prototype.name = 'IMTAN';
cIMTAN.prototype.argumentsMin = 1;
cIMTAN.prototype.argumentsMax = 1;
cIMTAN.prototype.isXLFN = true;
......@@ -6949,11 +7023,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cOCT2BIN() {
cBaseFunction.call(this, "OCT2BIN");
this.value = null;
this.argumentsCurrent = 0;
}
cOCT2BIN.prototype = Object.create(cBaseFunction.prototype);
cOCT2BIN.prototype.constructor = cOCT2BIN;
cOCT2BIN.prototype.name = 'OCT2BIN';
cOCT2BIN.prototype.argumentsMin = 1;
cOCT2BIN.prototype.argumentsMax = 2;
cOCT2BIN.prototype.Calculate = function (arg) {
......@@ -7020,11 +7096,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cOCT2DEC() {
cBaseFunction.call(this, "OCT2DEC");
this.value = null;
this.argumentsCurrent = 0;
}
cOCT2DEC.prototype = Object.create(cBaseFunction.prototype);
cOCT2DEC.prototype.constructor = cOCT2DEC;
cOCT2DEC.prototype.name = 'OCT2DEC';
cOCT2DEC.prototype.argumentsMin = 1;
cOCT2DEC.prototype.argumentsMax = 1;
cOCT2DEC.prototype.Calculate = function (arg) {
......@@ -7067,11 +7145,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cOCT2HEX() {
cBaseFunction.call(this, "OCT2HEX");
this.value = null;
this.argumentsCurrent = 0;
}
cOCT2HEX.prototype = Object.create(cBaseFunction.prototype);
cOCT2HEX.prototype.constructor = cOCT2HEX;
cOCT2HEX.prototype.name = 'OCT2HEX';
cOCT2HEX.prototype.argumentsMin = 1;
cOCT2HEX.prototype.argumentsMax = 2;
cOCT2HEX.prototype.Calculate = function (arg) {
......
......@@ -36,7 +36,7 @@
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
function (window, undefined) {
function _getRowTitle(row) {
return "" + (row + 1);
}
......@@ -217,11 +217,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cAREAS() {
cBaseFunction.call(this, "AREAS");
this.value = null;
this.argumentsCurrent = 0;
}
cAREAS.prototype = Object.create(cBaseFunction.prototype);
cAREAS.prototype.constructor = cAREAS;
cAREAS.prototype.name = 'AREAS';
/**
* @constructor
......@@ -353,11 +355,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cGETPIVOTDATA() {
cBaseFunction.call(this, "GETPIVOTDATA");
this.value = null;
this.argumentsCurrent = 0;
}
cGETPIVOTDATA.prototype = Object.create(cBaseFunction.prototype);
cGETPIVOTDATA.prototype.constructor = cGETPIVOTDATA;
cGETPIVOTDATA.prototype.name = 'GETPIVOTDATA';
/**
* @constructor
......@@ -382,11 +386,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cHYPERLINK() {
cBaseFunction.call(this, "HYPERLINK");
this.value = null;
this.argumentsCurrent = 0;
}
cHYPERLINK.prototype = Object.create(cBaseFunction.prototype);
cHYPERLINK.prototype.constructor = cHYPERLINK;
cHYPERLINK.prototype.name = 'HYPERLINK';
/**
* @constructor
......@@ -449,8 +455,8 @@
if (arg1 > Math.abs(bbox.r1 - bbox.r2) + 1 || arg2 > Math.abs(bbox.c1 - bbox.c2) + 1) {
res = new cError(cErrorType.bad_reference);
} else {
res = new Asc.Range(bbox.c1 + arg2 - 1, bbox.r1 + arg1 - 1, bbox.c1 + arg2 - 1,
bbox.r1 + arg1 - 1)
res = new Asc.Range(bbox.c1 + arg2 - 1, bbox.r1 + arg1 - 1, bbox.c1 + arg2 - 1, bbox.r1 + arg1 -
1)
res = new cRef(res.getName(), ws);
}
}
......@@ -581,9 +587,9 @@
}
if (!( (cElementType.cellsRange === arg1.type || cElementType.cellsRange3D === arg1.type ||
cElementType.array === arg1.type) &&
(cElementType.cellsRange === arg2.type || cElementType.cellsRange3D === arg2.type ||
cElementType.array === arg2.type) )) {
cElementType.array === arg1.type) &&
(cElementType.cellsRange === arg2.type || cElementType.cellsRange3D === arg2.type ||
cElementType.array === arg2.type) )) {
return this.value = new cError(cErrorType.not_available);
}
......@@ -712,7 +718,7 @@
var a0Type = a0.type;
var a0Value = a0.getValue();
if (!(cElementType.number === a0Type || cElementType.string === a0Type || cElementType.bool === a0Type ||
cElementType.error === a0Type || cElementType.empty === a0Type)) {
cElementType.error === a0Type || cElementType.empty === a0Type)) {
a0Type = a0Value.type;
a0Value = a0Value.getValue();
}
......@@ -932,11 +938,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cRTD() {
cBaseFunction.call(this, "RTD");
this.value = null;
this.argumentsCurrent = 0;
}
cRTD.prototype = Object.create(cBaseFunction.prototype);
cRTD.prototype.constructor = cRTD;
cRTD.prototype.name = 'RTD';
/**
* @constructor
......
......@@ -2382,12 +2382,9 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
};
/** @constructor */
function cBaseFunction(name) {
this.name = name;
function cBaseFunction() {
this.value = null;
this.argumentsCurrent = 0;
// this.isXLFN = rx_sFuncPref.test(this.name);
}
cBaseFunction.prototype.type = cElementType.func;
......
......@@ -36,7 +36,7 @@
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
function (window, undefined) {
var fSortAscending = AscCommon.fSortAscending;
var cElementType = AscCommonExcel.cElementType;
......@@ -142,34 +142,34 @@
if (Math.abs(q) <= .425) {
t = 0.180625 - q * q;
z = q * (
(
(
(
(
(
(
(
t * 2509.0809287301226727 + 33430.575583588128105
) * t + 67265.770927008700853
) * t + 45921.953931549871457
) * t + 13731.693765509461125
) * t + 1971.5909503065514427
) * t + 133.14166789178437745
) * t + 3.387132872796366608
) / (
t * 2509.0809287301226727 + 33430.575583588128105
) * t + 67265.770927008700853
) * t + 45921.953931549871457
) * t + 13731.693765509461125
) * t + 1971.5909503065514427
) * t + 133.14166789178437745
) * t + 3.387132872796366608
) / (
(
(
(
(
(
(
(
t * 5226.495278852854561 + 28729.085735721942674
) * t + 39307.89580009271061
) * t + 21213.794301586595867
) * t + 5394.1960214247511077
) * t + 687.1870074920579083
) * t + 42.313330701600911252
) * t + 1
);
t * 5226.495278852854561 + 28729.085735721942674
) * t + 39307.89580009271061
) * t + 21213.794301586595867
) * t + 5394.1960214247511077
) * t + 687.1870074920579083
) * t + 42.313330701600911252
) * t + 1
);
} else {
if (q > 0) {
t = 1 - x;
......@@ -182,65 +182,65 @@
if (t <= 5) {
t += -1.6;
z = (
(
(
(
(
(
(
(
t * 7.7454501427834140764e-4 + 0.0227238449892691845833
) * t + 0.24178072517745061177
) * t + 1.27045825245236838258
) * t + 3.64784832476320460504
) * t + 5.7694972214606914055
) * t + 4.6303378461565452959
) * t + 1.42343711074968357734
) / (
t * 7.7454501427834140764e-4 + 0.0227238449892691845833
) * t + 0.24178072517745061177
) * t + 1.27045825245236838258
) * t + 3.64784832476320460504
) * t + 5.7694972214606914055
) * t + 4.6303378461565452959
) * t + 1.42343711074968357734
) / (
(
(
(
(
(
(
(
t * 1.05075007164441684324e-9 + 5.475938084995344946e-4
) * t + 0.0151986665636164571966
) * t + 0.14810397642748007459
) * t + 0.68976733498510000455
) * t + 1.6763848301838038494
) * t + 2.05319162663775882187
) * t + 1
);
t * 1.05075007164441684324e-9 + 5.475938084995344946e-4
) * t + 0.0151986665636164571966
) * t + 0.14810397642748007459
) * t + 0.68976733498510000455
) * t + 1.6763848301838038494
) * t + 2.05319162663775882187
) * t + 1
);
} else {
t += -5;
z = (
(
(
(
(
(
(
(
t * 2.01033439929228813265e-7 + 2.71155556874348757815e-5
) * t + 0.0012426609473880784386
) * t + 0.026532189526576123093
) * t + 0.29656057182850489123
) * t + 1.7848265399172913358
) * t + 5.4637849111641143699
) * t + 6.6579046435011037772
) / (
t * 2.01033439929228813265e-7 + 2.71155556874348757815e-5
) * t + 0.0012426609473880784386
) * t + 0.026532189526576123093
) * t + 0.29656057182850489123
) * t + 1.7848265399172913358
) * t + 5.4637849111641143699
) * t + 6.6579046435011037772
) / (
(
(
(
(
(
(
(
t * 2.04426310338993978564e-15 + 1.4215117583164458887e-7
) * t + 1.8463183175100546818e-5
) * t + 7.868691311456132591e-4
) * t + 0.0148753612908506148525
) * t + 0.13692988092273580531
) * t + 0.59983220655588793769
) * t + 1
);
t * 2.04426310338993978564e-15 + 1.4215117583164458887e-7
) * t + 1.8463183175100546818e-5
) * t + 7.868691311456132591e-4
) * t + 0.0148753612908506148525
) * t + 0.13692988092273580531
) * t + 0.59983220655588793769
) * t + 1
);
}
if (q < 0) {
......@@ -2986,10 +2986,10 @@
// adjust average value for position within period
if (this.bAdditive) {
fI += ( this.maRange[i * this.mnSmplInPrd + j].Y -
( aPeriodAverage[i] + ( j - 0.5 * ( this.mnSmplInPrd - 1 ) ) * this.mpTrend[0] ) );
( aPeriodAverage[i] + ( j - 0.5 * ( this.mnSmplInPrd - 1 ) ) * this.mpTrend[0] ) );
} else {
fI += ( this.maRange[i * this.mnSmplInPrd + j].Y /
( aPeriodAverage[i] + ( j - 0.5 * ( this.mnSmplInPrd - 1 ) ) * this.mpTrend[0] ) );
( aPeriodAverage[i] + ( j - 0.5 * ( this.mnSmplInPrd - 1 ) ) * this.mpTrend[0] ) );
}
}
this.mpPerIdx[j] = fI / nPeriods;
......@@ -3264,8 +3264,8 @@
// forecast 1 step ahead
for (var i = 1; i < this.mnCount; i++) {
if (this.bEDS) {
this.mpBase[i] = this.mfAlpha * this.maRange[i].Y +
( 1 - this.mfAlpha ) * ( this.mpBase[i - 1] + this.mpTrend[i - 1] );
this.mpBase[i] = this.mfAlpha * this.maRange[i].Y + ( 1 - this.mfAlpha ) *
( this.mpBase[i - 1] + this.mpTrend[i - 1] );
this.mpTrend[i] =
this.mfGamma * ( this.mpBase[i] - this.mpBase[i - 1] ) + ( 1 - this.mfGamma ) * this.mpTrend[i - 1];
this.mpForecast[i] = this.mpBase[i - 1] + this.mpTrend[i - 1];
......@@ -3273,16 +3273,16 @@
var nIdx;
if (this.bAdditive) {
nIdx = ( i > this.mnSmplInPrd ? i - this.mnSmplInPrd : i );
this.mpBase[i] = this.mfAlpha * ( this.maRange[i].Y - this.mpPerIdx[nIdx] ) +
( 1 - this.mfAlpha ) * ( this.mpBase[i - 1] + this.mpTrend[i - 1] );
this.mpPerIdx[i] = this.mfBeta * ( this.maRange[i].Y - this.mpBase[i] ) +
( 1 - this.mfBeta ) * this.mpPerIdx[nIdx];
this.mpBase[i] = this.mfAlpha * ( this.maRange[i].Y - this.mpPerIdx[nIdx] ) + ( 1 - this.mfAlpha ) *
( this.mpBase[i - 1] + this.mpTrend[i - 1] );
this.mpPerIdx[i] = this.mfBeta * ( this.maRange[i].Y - this.mpBase[i] ) + ( 1 - this.mfBeta ) *
this.mpPerIdx[nIdx];
} else {
nIdx = ( i >= this.mnSmplInPrd ? i - this.mnSmplInPrd : i );
this.mpBase[i] = this.mfAlpha * ( this.maRange[i].Y / this.mpPerIdx[nIdx] ) +
( 1 - this.mfAlpha ) * ( this.mpBase[i - 1] + this.mpTrend[i - 1] );
this.mpPerIdx[i] = this.mfBeta * ( this.maRange[i].Y / this.mpBase[i] ) +
( 1 - this.mfBeta ) * this.mpPerIdx[this.nIdx];
this.mpBase[i] = this.mfAlpha * ( this.maRange[i].Y / this.mpPerIdx[nIdx] ) + ( 1 - this.mfAlpha ) *
( this.mpBase[i - 1] + this.mpTrend[i - 1] );
this.mpPerIdx[i] = this.mfBeta * ( this.maRange[i].Y / this.mpBase[i] ) + ( 1 - this.mfBeta ) *
this.mpPerIdx[this.nIdx];
}
this.mpTrend[i] =
this.mfGamma * ( this.mpBase[i] - this.mpBase[i - 1] ) + ( 1 - this.mfGamma ) * this.mpTrend[i - 1];
......@@ -3494,10 +3494,10 @@
aPredictions[0][k] = xScenRange[0];
xScenBase[0] = this.mfAlpha * ( xScenRange[0] - this.mpPerIdx[this.mnCount - this.mnSmplInPrd] ) +
( 1 - this.mfAlpha ) * ( this.mpBase[this.mnCount - 1] + this.mpTrend[this.mnCount - 1] );
xScenTrend[0] = this.mfGamma * ( xScenBase[0] - this.mpBase[this.mnCount - 1] ) +
( 1 - this.mfGamma ) * this.mpTrend[this.mnCount - 1];
xScenPerIdx[0] = this.mfBeta * ( xScenRange[0] - xScenBase[0] ) +
( 1 - this.mfBeta ) * this.mpPerIdx[this.mnCount - this.mnSmplInPrd];
xScenTrend[0] = this.mfGamma * ( xScenBase[0] - this.mpBase[this.mnCount - 1] ) + ( 1 - this.mfGamma ) *
this.mpTrend[this.mnCount - 1];
xScenPerIdx[0] = this.mfBeta * ( xScenRange[0] - xScenBase[0] ) + ( 1 - this.mfBeta ) *
this.mpPerIdx[this.mnCount - this.mnSmplInPrd];
for (var i = 1; i < nSize; i++) {
var fPerIdx;
if (i < this.mnSmplInPrd) {
......@@ -3511,8 +3511,8 @@
aPredictions[i] = [];
}
aPredictions[i][k] = xScenRange[i];
xScenBase[i] = this.mfAlpha * ( xScenRange[i] - fPerIdx ) +
( 1 - this.mfAlpha ) * ( xScenBase[i - 1] + xScenTrend[i - 1] );
xScenBase[i] = this.mfAlpha * ( xScenRange[i] - fPerIdx ) + ( 1 - this.mfAlpha ) *
( xScenBase[i - 1] + xScenTrend[i - 1] );
xScenTrend[i] =
this.mfGamma * ( xScenBase[i] - xScenBase[i - 1] ) + ( 1 - this.mfGamma ) * xScenTrend[i - 1];
xScenPerIdx[i] = this.mfBeta * ( xScenRange[i] - xScenBase[i] ) + ( 1 - this.mfBeta ) * fPerIdx;
......@@ -3528,10 +3528,10 @@
aPredictions[0][k] = xScenRange[0];
xScenBase[0] = this.mfAlpha * ( xScenRange[0] / this.mpPerIdx[this.mnCount - this.mnSmplInPrd] ) +
( 1 - this.mfAlpha ) * ( this.mpBase[this.mnCount - 1] + this.mpTrend[this.mnCount - 1] );
xScenTrend[0] = this.mfGamma * ( xScenBase[0] - this.mpBase[this.mnCount - 1] ) +
( 1 - this.mfGamma ) * this.mpTrend[this.mnCount - 1];
xScenPerIdx[0] = this.mfBeta * ( xScenRange[0] / xScenBase[0] ) +
( 1 - this.mfBeta ) * this.mpPerIdx[this.mnCount - this.mnSmplInPrd];
xScenTrend[0] = this.mfGamma * ( xScenBase[0] - this.mpBase[this.mnCount - 1] ) + ( 1 - this.mfGamma ) *
this.mpTrend[this.mnCount - 1];
xScenPerIdx[0] = this.mfBeta * ( xScenRange[0] / xScenBase[0] ) + ( 1 - this.mfBeta ) *
this.mpPerIdx[this.mnCount - this.mnSmplInPrd];
for (var i = 1; i < nSize; i++) {
var fPerIdx;
if (i < this.mnSmplInPrd) {
......@@ -3545,8 +3545,8 @@
aPredictions[i] = [];
}
aPredictions[i][k] = xScenRange[i];
xScenBase[i] = this.mfAlpha * ( xScenRange[i] / fPerIdx ) +
( 1 - this.mfAlpha ) * ( xScenBase[i - 1] + xScenTrend[i - 1] );
xScenBase[i] = this.mfAlpha * ( xScenRange[i] / fPerIdx ) + ( 1 - this.mfAlpha ) *
( xScenBase[i - 1] + xScenTrend[i - 1] );
xScenTrend[i] =
this.mfGamma * ( xScenBase[i] - xScenBase[i - 1] ) + ( 1 - this.mfGamma ) * xScenTrend[i - 1];
xScenPerIdx[i] = this.mfBeta * ( xScenRange[i] / xScenBase[i] ) + ( 1 - this.mfBeta ) * fPerIdx;
......@@ -3625,8 +3625,8 @@
//std::vector< double > c( nSize );
for (var i = 0; i < nSize; i++) {
c[i] = Math.sqrt(1 + ( fPILevel / Math.pow(1 + o, 3.0) ) *
( ( 1 + 4 * o + 5 * o * o ) + 2 * ( i ) * fPILevel * ( 1 + 3 * o ) +
2 * ( i * i ) * fPILevel * fPILevel ));
( ( 1 + 4 * o + 5 * o * o ) + 2 * ( i ) * fPILevel * ( 1 + 3 * o ) + 2 * ( i * i ) * fPILevel *
fPILevel ));
}
......@@ -3908,10 +3908,10 @@
cAVERAGEIF.prototype.argumentsMax = 3;
cAVERAGEIF.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : arg[0], _sum = 0, _count = 0, matchingInfo, ws;
if ((cElementType.cell !== arg0.type && cElementType.cell3D !== arg0.type &&
cElementType.cellsRange !== arg0.type) ||
(cElementType.cell !== arg2.type && cElementType.cell3D !== arg2.type &&
cElementType.cellsRange !== arg2.type)) {
if ((cElementType.cell !== arg0.type && cElementType.cell3D !== arg0.type && cElementType.cellsRange !==
arg0.type) ||
(cElementType.cell !== arg2.type && cElementType.cell3D !== arg2.type && cElementType.cellsRange !==
arg2.type)) {
return this.value = new cError(cErrorType.wrong_value_type);
}
......@@ -3998,8 +3998,8 @@
arg1 = arg[k];
arg2 = arg[k + 1];
if ((cElementType.cell !== arg1.type && cElementType.cell3D !== arg1.type &&
cElementType.cellsRange !== arg1.type)) {
if ((cElementType.cell !== arg1.type && cElementType.cell3D !== arg1.type && cElementType.cellsRange !==
arg1.type)) {
return this.value = new cError(cErrorType.wrong_value_type);
}
......@@ -4403,11 +4403,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cCHIINV() {
cBaseFunction.call(this, "CHIINV");
this.value = null;
this.argumentsCurrent = 0;
}
cCHIINV.prototype = Object.create(cBaseFunction.prototype);
cCHIINV.prototype.constructor = cCHIINV;
cCHIINV.prototype.name = 'CHIINV';
cCHIINV.prototype.argumentsMin = 2;
cCHIINV.prototype.argumentsMax = 2;
cCHIINV.prototype.Calculate = function (arg) {
......@@ -4450,11 +4452,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cCHISQ_DIST() {
cBaseFunction.call(this, "CHISQ.DIST");
this.value = null;
this.argumentsCurrent = 0;
}
cCHISQ_DIST.prototype = Object.create(cBaseFunction.prototype);
cCHISQ_DIST.prototype.constructor = cCHISQ_DIST;
cCHISQ_DIST.prototype.name = 'CHISQ.DIST';
cCHISQ_DIST.prototype.argumentsMin = 3;
cCHISQ_DIST.prototype.argumentsMax = 3;
cCHISQ_DIST.prototype.isXLFN = true;
......@@ -4515,11 +4519,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cCHISQ_INV() {
cBaseFunction.call(this, "CHISQ.INV");
this.value = null;
this.argumentsCurrent = 0;
}
cCHISQ_INV.prototype = Object.create(cBaseFunction.prototype);
cCHISQ_INV.prototype.constructor = cCHISQ_INV;
cCHISQ_INV.prototype.name = 'CHISQ.INV';
cCHISQ_INV.prototype.argumentsMin = 2;
cCHISQ_INV.prototype.argumentsMax = 2;
cCHISQ_INV.prototype.isXLFN = true;
......@@ -4563,12 +4569,14 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cCHISQ_INV_RT() {
cBaseFunction.call(this, "CHISQ.INV.RT");
this.value = null;
this.argumentsCurrent = 0;
}
//TODO check max 64 iterations(from documentaion)
cCHISQ_INV_RT.prototype = Object.create(cBaseFunction.prototype);
cCHISQ_INV_RT.prototype.constructor = cCHISQ_INV_RT;
cCHISQ_INV_RT.prototype.name = 'CHISQ.INV.RT';
cCHISQ_INV_RT.prototype.argumentsMin = 2;
cCHISQ_INV_RT.prototype.argumentsMax = 2;
cCHISQ_INV_RT.prototype.isXLFN = true;
......@@ -5766,11 +5774,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cF_INV() {
cBaseFunction.call(this, "F.INV");
this.value = null;
this.argumentsCurrent = 0;
}
cF_INV.prototype = Object.create(cBaseFunction.prototype);
cF_INV.prototype.constructor = cF_INV;
cF_INV.prototype.name = 'F.INV';
cF_INV.prototype.argumentsMin = 3;
cF_INV.prototype.argumentsMax = 3;
cF_INV.prototype.isXLFN = true;
......@@ -7020,11 +7030,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cHYPGEOM_DIST() {
cBaseFunction.call(this, "HYPGEOM.DIST");
this.value = null;
this.argumentsCurrent = 0;
}
cHYPGEOM_DIST.prototype = Object.create(cBaseFunction.prototype);
cHYPGEOM_DIST.prototype.constructor = cHYPGEOM_DIST;
cHYPGEOM_DIST.prototype.name = 'HYPGEOM.DIST';
cHYPGEOM_DIST.prototype.argumentsMin = 5;
cHYPGEOM_DIST.prototype.argumentsMax = 5;
cHYPGEOM_DIST.prototype.isXLFN = true;
......@@ -7208,9 +7220,8 @@
}
return new cNumber(
xLength * (xLength + 1) / (xLength - 1) / (xLength - 2) / (xLength - 3) * sumSQRDeltaXDivstandDev -
3 * (xLength - 1) * (xLength - 1) / (xLength - 2) / (xLength - 3))
return new cNumber(xLength * (xLength + 1) / (xLength - 1) / (xLength - 2) / (xLength - 3) *
sumSQRDeltaXDivstandDev - 3 * (xLength - 1) * (xLength - 1) / (xLength - 2) / (xLength - 3))
}
......@@ -7376,6 +7387,7 @@
cLOGEST.prototype.name = 'LOGEST';
cLOGEST.prototype.argumentsMin = 1;
cLOGEST.prototype.argumentsMax = 4;
/*cLOGEST.prototype.Calculate = function (arg) {
arg[0] = tryNumberToArray(arg[0]);
......@@ -7866,8 +7878,8 @@
for (j = 0; j < arg1Matrix[i].length; ++j) {
if (arg0Matrix[i][j] && !AscCommonExcel.matching(arg1Matrix[i][j], matchingInfo)) {
//MS считает в данном случае, что значение 0 (из диапазона условий) соответсвует условию = ""
if (!(null === matchingInfo.op && "" === matchingInfo.val.value &&
0 === arg1Matrix[i][j].value)) {
if (!(null === matchingInfo.op && "" === matchingInfo.val.value && 0 ===
arg1Matrix[i][j].value)) {
arg0Matrix[i][j] = null;
}
}
......@@ -7972,8 +7984,8 @@
for (j = 0; j < arg1Matrix[i].length; ++j) {
if (arg0Matrix[i][j] && !AscCommonExcel.matching(arg1Matrix[i][j], matchingInfo)) {
//MS считает в данном случае, что значение 0 (из диапазона условий) соответсвует условию = ""
if (!(null === matchingInfo.op && "" === matchingInfo.val.value &&
0 === arg1Matrix[i][j].value)) {
if (!(null === matchingInfo.op && "" === matchingInfo.val.value && 0 ===
arg1Matrix[i][j].value)) {
arg0Matrix[i][j] = null;
}
}
......@@ -8366,11 +8378,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cNEGBINOMDIST() {
cBaseFunction.call(this, "NEGBINOMDIST");
this.value = null;
this.argumentsCurrent = 0;
}
cNEGBINOMDIST.prototype = Object.create(cBaseFunction.prototype);
cNEGBINOMDIST.prototype.constructor = cNEGBINOMDIST;
cNEGBINOMDIST.prototype.name = 'NEGBINOMDIST';
cNEGBINOMDIST.prototype.argumentsMin = 3;
cNEGBINOMDIST.prototype.argumentsMax = 3;
cNEGBINOMDIST.prototype.Calculate = function (arg) {
......@@ -8405,11 +8419,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cNEGBINOM_DIST() {
cBaseFunction.call(this, "NEGBINOM.DIST");
this.value = null;
this.argumentsCurrent = 0;
}
cNEGBINOM_DIST.prototype = Object.create(cBaseFunction.prototype);
cNEGBINOM_DIST.prototype.constructor = cNEGBINOM_DIST;
cNEGBINOM_DIST.prototype.name = 'NEGBINOM.DIST';
cNEGBINOM_DIST.prototype.argumentsMin = 4;
cNEGBINOM_DIST.prototype.argumentsMax = 4;
cNEGBINOM_DIST.prototype.isXLFN = true;
......@@ -9550,11 +9566,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cRANK_AVG() {
cBaseFunction.call(this, "RANK.AVG");
this.value = null;
this.argumentsCurrent = 0;
}
cRANK_AVG.prototype = Object.create(cBaseFunction.prototype);
cRANK_AVG.prototype.constructor = cRANK_AVG;
cRANK_AVG.prototype.name = 'RANK.AVG';
cRANK_AVG.prototype.argumentsMin = 2;
cRANK_AVG.prototype.argumentsMax = 3;
cRANK_AVG.prototype.isXLFN = true;
......@@ -10419,11 +10437,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cTDIST() {
cBaseFunction.call(this, "TDIST");
this.value = null;
this.argumentsCurrent = 0;
}
cTDIST.prototype = Object.create(cBaseFunction.prototype);
cTDIST.prototype.constructor = cTDIST;
cTDIST.prototype.name = 'TDIST';
cTDIST.prototype.argumentsMin = 3;
cTDIST.prototype.argumentsMax = 3;
cTDIST.prototype.Calculate = function (arg) {
......@@ -10461,11 +10481,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cT_DIST() {
cBaseFunction.call(this, "T.DIST");
this.value = null;
this.argumentsCurrent = 0;
}
cT_DIST.prototype = Object.create(cBaseFunction.prototype);
cT_DIST.prototype.constructor = cT_DIST;
cT_DIST.prototype.name = 'T.DIST';
cT_DIST.prototype.argumentsMin = 3;
cT_DIST.prototype.argumentsMax = 3;
cT_DIST.prototype.isXLFN = true;
......@@ -10503,11 +10525,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cT_DIST_2T() {
cBaseFunction.call(this, "T.DIST.2T");
this.value = null;
this.argumentsCurrent = 0;
}
cT_DIST_2T.prototype = Object.create(cBaseFunction.prototype);
cT_DIST_2T.prototype.constructor = cT_DIST_2T;
cT_DIST_2T.prototype.name = 'T.DIST.2T';
cT_DIST_2T.prototype.argumentsMin = 2;
cT_DIST_2T.prototype.argumentsMax = 2;
cT_DIST_2T.prototype.isXLFN = true;
......@@ -10543,11 +10567,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cT_DIST_RT() {
cBaseFunction.call(this, "T.DIST.RT");
this.value = null;
this.argumentsCurrent = 0;
}
cT_DIST_RT.prototype = Object.create(cBaseFunction.prototype);
cT_DIST_RT.prototype.constructor = cT_DIST_RT;
cT_DIST_RT.prototype.name = 'T.DIST.RT';
cT_DIST_RT.prototype.argumentsMin = 2;
cT_DIST_RT.prototype.argumentsMax = 2;
cT_DIST_RT.prototype.isXLFN = true;
......@@ -10587,11 +10613,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cT_INV() {
cBaseFunction.call(this, "T.INV");
this.value = null;
this.argumentsCurrent = 0;
}
cT_INV.prototype = Object.create(cBaseFunction.prototype);
cT_INV.prototype.constructor = cT_INV;
cT_INV.prototype.name = 'T.INV';
cT_INV.prototype.argumentsMin = 2;
cT_INV.prototype.argumentsMax = 2;
cT_INV.prototype.isXLFN = true;
......@@ -10645,11 +10673,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cT_INV_2T() {
cBaseFunction.call(this, "T.INV.2T");
this.value = null;
this.argumentsCurrent = 0;
}
cT_INV_2T.prototype = Object.create(cBaseFunction.prototype);
cT_INV_2T.prototype.constructor = cT_INV_2T;
cT_INV_2T.prototype.name = 'T.INV.2T';
cT_INV_2T.prototype.argumentsMin = 2;
cT_INV_2T.prototype.argumentsMax = 2;
cT_INV_2T.prototype.isXLFN = true;
......
......@@ -36,7 +36,7 @@
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
function (window, undefined) {
// Import
var cElementType = AscCommonExcel.cElementType;
var CellValueType = AscCommon.CellValueType;
......@@ -70,22 +70,26 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cASC() {
cBaseFunction.call(this, "ASC");
this.value = null;
this.argumentsCurrent = 0;
}
cASC.prototype = Object.create(cBaseFunction.prototype);
cASC.prototype.constructor = cASC;
cASC.prototype.name = 'ASC';
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cBAHTTEXT() {
cBaseFunction.call(this, "BAHTTEXT");
this.value = null;
this.argumentsCurrent = 0;
}
cBAHTTEXT.prototype = Object.create(cBaseFunction.prototype);
cBAHTTEXT.prototype.constructor = cBAHTTEXT;
cBAHTTEXT.prototype.name = 'BAHTTEXT';
/**
* @constructor
......@@ -858,11 +862,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cJIS() {
cBaseFunction.call(this, "JIS");
this.value = null;
this.argumentsCurrent = 0;
}
cJIS.prototype = Object.create(cBaseFunction.prototype);
cJIS.prototype.constructor = cJIS;
cJIS.prototype.name = 'JIS';
/**
* @constructor
......@@ -1219,11 +1225,13 @@
* @extends {AscCommonExcel.cBaseFunction}
*/
function cPHONETIC() {
cBaseFunction.call(this, "PHONETIC");
this.value = null;
this.argumentsCurrent = 0;
}
cPHONETIC.prototype = Object.create(cBaseFunction.prototype);
cPHONETIC.prototype.constructor = cPHONETIC;
cPHONETIC.prototype.name = 'PHONETIC';
/**
* @constructor
......
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