Commit 3ba0579b authored by Alexander.Trofimov's avatar Alexander.Trofimov

instanceof -> check type

parent dba3078c
...@@ -582,128 +582,117 @@ cAVERAGEA.prototype.getInfo = function () { ...@@ -582,128 +582,117 @@ cAVERAGEA.prototype.getInfo = function () {
}; };
}; };
function cAVERAGEIF() { function cAVERAGEIF() {
// cBaseFunction.call( this, "AVERAGEIF", 2, 3 ); this.name = "AVERAGEIF";
this.type = cElementType.func;
this.name = "AVERAGEIF"; this.value = null;
this.type = cElementType.func; this.argumentsMin = 2;
this.value = null; this.argumentsCurrent = 0;
this.argumentsMin = 2; this.argumentsMax = 3;
this.argumentsCurrent = 0; this.formatType = {
this.argumentsMax = 3; def: -1, //подразумевается формат первой ячейки входящей в формулу.
this.formatType = { noneFormat: -2
def:-1, //подразумевается формат первой ячейки входящей в формулу. };
noneFormat:-2 this.numFormat = this.formatType.def;
}; }
this.numFormat = this.formatType.def;
cAVERAGEIF.prototype = Object.create(cBaseFunction.prototype);
} cAVERAGEIF.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : arg[0], _sum = 0, _count = 0, valueForSearching;
cAVERAGEIF.prototype = Object.create( cBaseFunction.prototype ) if ((cElementType.cell !== arg0.type && cElementType.cell3D !== arg0.type &&
cAVERAGEIF.prototype.Calculate = function ( arg ) { cElementType.cellsRange !== arg0.type) ||
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : arg[0], _sum = 0, _count = 0, valueForSearching; (cElementType.cell !== arg2.type && cElementType.cell3D !== arg2.type &&
if ( !(arg0 instanceof cRef || arg0 instanceof cRef3D || arg0 instanceof cArea) ) { cElementType.cellsRange !== arg2.type)) {
return this.value = new cError( cErrorType.wrong_value_type ); return this.value = new cError(cErrorType.wrong_value_type);
} }
if ( !(arg2 instanceof cRef || arg2 instanceof cRef3D || arg2 instanceof cArea) ) { if (cElementType.cellsRange === arg1.type || cElementType.cellsRange3D === arg1.type) {
return this.value = new cError( cErrorType.wrong_value_type ); arg1 = arg1.cross(arguments[1].first);
} } else if (arg1 instanceof cArray) {
arg1 = arg1.getElementRowCol(0, 0);
if ( arg1 instanceof cArea || arg1 instanceof cArea3D ) { }
arg1 = arg1.cross( arguments[1].first );
} arg1 = arg1.tocString();
else if ( arg1 instanceof cArray ) {
arg1 = arg1.getElementRowCol( 0, 0 ); if (cElementType.string !== arg1.type) {
} return this.value = new cError(cErrorType.wrong_value_type);
}
arg1 = arg1.tocString();
arg1 = arg1.toString();
if ( !(arg1 instanceof cString) ) { var operators = new RegExp("^ *[<=> ]+ *"), match = arg1.match(operators), search, oper, val;
return this.value = new cError( cErrorType.wrong_value_type ); if (match) {
} search = arg1.substr(match[0].length);
oper = match[0].replace(/\s/g, "");
arg1 = arg1.toString(); } else {
var operators = new RegExp( "^ *[<=> ]+ *" ), match = arg1.match( operators ), search = arg1;
search, oper, val; }
if ( match ) { valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search);
search = arg1.substr( match[0].length ); if (arg0 instanceof cArea) {
oper = match[0].replace( /\s/g, "" ); var r = arg0.getRange().first.getRow0(), ws = arg0.getWS(), c/*c1*/ = arg2.getRange().first
} .getCol0(), i = 0, tmpCellArg0 = arg0.getRange()
else { .getCells()[0], tmpCellArg2 = arg2.getRange(), offset, bbox, r2;
search = arg1; arg0.foreach2(function (v, cell) {
} if (matching(v, valueForSearching, oper)) {
valueForSearching = parseNum( search ) ? new cNumber( search ) : new cString( search ); offset = cell.getOffset(tmpCellArg0);
if ( arg0 instanceof cArea ) { tmpCellArg2 = arg2.getRange();
var r = arg0.getRange().first.getRow0(), ws = arg0.getWS(), c/*c1*/ = arg2.getRange().first.getCol0(), i = 0, tmpCellArg2.setOffset(offset);
tmpCellArg0 = arg0.getRange().getCells()[0], bbox = tmpCellArg2.getBBox0();
tmpCellArg2 = arg2.getRange(), offset.offsetCol *= -1;
offset, bbox, r2; offset.offsetRow *= -1;
arg0.foreach2( function ( v, cell ) {
if ( matching( v, valueForSearching, oper ) ) { r2 = new cRef(ws.getRange3(bbox.r1, bbox.c1, bbox.r1, bbox.c1).getName(), ws);
offset = cell.getOffset(tmpCellArg0);
tmpCellArg2 = arg2.getRange(); tmpCellArg2.setOffset(offset);
tmpCellArg2.setOffset(offset);
bbox = tmpCellArg2.getBBox0(); if (cElementType.number === r2.getValue().type) {
offset.offsetCol *= -1; _sum += r2.getValue().getValue();
offset.offsetRow *= -1; _count++;
}
r2 = new cRef( ws.getRange3( bbox.r1, bbox.c1, bbox.r1, bbox.c1 ).getName(), ws ); }
i++;
tmpCellArg2.setOffset(offset); })
} else {
if ( r2.getValue() instanceof cNumber ) { val = arg0.getValue();
_sum += r2.getValue().getValue(); if (matching(val, valueForSearching, oper)) {
var r = arg0.getRange(), ws = arg0.getWS(), r1 = r.first.getRow0() + 0, c1 = arg2.getRange().first
.getCol0();
r = new cRef(ws.getRange3(r1, c1, r1, c1).getName(), ws);
if (cElementType.number === r.getValue().type) {
_sum += r.getValue().getValue();
_count++; _count++;
} }
} }
i++;
} )
}
else {
val = arg0.getValue();
if ( matching( val, valueForSearching, oper ) ) {
var r = arg0.getRange(), ws = arg0.getWS(),
r1 = r.first.getRow0() + 0, c1 = arg2.getRange().first.getCol0();
r = new cRef( ws.getRange3( r1, c1, r1, c1 ).getName(), ws );
if ( r.getValue() instanceof cNumber ) {
_sum += r.getValue().getValue();
_count++;
}
} }
}
if ( _count == 0 ) { if (_count == 0) {
return new cError( cErrorType.division_by_zero ); return new cError(cErrorType.division_by_zero);
} } else {
else { return this.value = new cNumber(_sum / _count);
return this.value = new cNumber( _sum / _count ); }
} };
} cAVERAGEIF.prototype.getInfo = function () {
cAVERAGEIF.prototype.getInfo = function () { return {
return { name: this.name, args: "( cell-range, selection-criteria [ , average-range ] )"
name:this.name, };
args:"( cell-range, selection-criteria [ , average-range ] )"
}; };
}
function cAVERAGEIFS() { function cAVERAGEIFS() {
cBaseFunction.call( this, "AVERAGEIFS" ); cBaseFunction.call(this, "AVERAGEIFS");
} }
cAVERAGEIFS.prototype = Object.create( cBaseFunction.prototype ) cAVERAGEIFS.prototype = Object.create(cBaseFunction.prototype);
function cBETADIST() {/*Нет реализации в Google Docs*/ function cBETADIST() {/*Нет реализации в Google Docs*/
cBaseFunction.call( this, "BETADIST" ); cBaseFunction.call(this, "BETADIST");
} }
cBETADIST.prototype = Object.create( cBaseFunction.prototype ) cBETADIST.prototype = Object.create(cBaseFunction.prototype);
function cBETAINV() {/*Нет реализации в Google Docs*/ function cBETAINV() {/*Нет реализации в Google Docs*/
cBaseFunction.call( this, "BETAINV" ); cBaseFunction.call(this, "BETAINV");
} }
cBETAINV.prototype = Object.create( cBaseFunction.prototype ) cBETAINV.prototype = Object.create(cBaseFunction.prototype);
function cBINOMDIST() { function cBINOMDIST() {
// cBaseFunction.call( this, "BINOMDIST" ); // cBaseFunction.call( this, "BINOMDIST" );
...@@ -724,7 +713,7 @@ function cBINOMDIST() { ...@@ -724,7 +713,7 @@ function cBINOMDIST() {
} }
cBINOMDIST.prototype = Object.create( cBaseFunction.prototype ) cBINOMDIST.prototype = Object.create( cBaseFunction.prototype );
cBINOMDIST.prototype.Calculate = function ( arg ) { cBINOMDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3];
...@@ -785,31 +774,31 @@ cBINOMDIST.prototype.Calculate = function ( arg ) { ...@@ -785,31 +774,31 @@ cBINOMDIST.prototype.Calculate = function ( arg ) {
} }
else else
return this.value = new cNumber( binomdist( arg0.getValue(), arg1.getValue(), arg2.getValue() ) ); return this.value = new cNumber( binomdist( arg0.getValue(), arg1.getValue(), arg2.getValue() ) );
} };
cBINOMDIST.prototype.getInfo = function () { cBINOMDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( number-successes , number-trials , success-probability , cumulative-flag )" args:"( number-successes , number-trials , success-probability , cumulative-flag )"
}; };
} };
function cCHIDIST() { function cCHIDIST() {
cBaseFunction.call( this, "CHIDIST" ); cBaseFunction.call( this, "CHIDIST" );
} }
cCHIDIST.prototype = Object.create( cBaseFunction.prototype ) cCHIDIST.prototype = Object.create( cBaseFunction.prototype );
function cCHIINV() { function cCHIINV() {
cBaseFunction.call( this, "CHIINV" ); cBaseFunction.call( this, "CHIINV" );
} }
cCHIINV.prototype = Object.create( cBaseFunction.prototype ) cCHIINV.prototype = Object.create( cBaseFunction.prototype );
function cCHITEST() { function cCHITEST() {
cBaseFunction.call( this, "CHITEST" ); cBaseFunction.call( this, "CHITEST" );
} }
cCHITEST.prototype = Object.create( cBaseFunction.prototype ) cCHITEST.prototype = Object.create( cBaseFunction.prototype );
function cCONFIDENCE() { function cCONFIDENCE() {
// cBaseFunction.call( this, "CONFIDENCE" ); // cBaseFunction.call( this, "CONFIDENCE" );
...@@ -830,7 +819,7 @@ function cCONFIDENCE() { ...@@ -830,7 +819,7 @@ function cCONFIDENCE() {
} }
cCONFIDENCE.prototype = Object.create( cBaseFunction.prototype ) cCONFIDENCE.prototype = Object.create( cBaseFunction.prototype );
cCONFIDENCE.prototype.Calculate = function ( arg ) { cCONFIDENCE.prototype.Calculate = function ( arg ) {
var alpha = arg[0], stdev_sigma = arg[1], size = arg[2]; var alpha = arg[0], stdev_sigma = arg[1], size = arg[2];
...@@ -868,13 +857,13 @@ cCONFIDENCE.prototype.Calculate = function ( arg ) { ...@@ -868,13 +857,13 @@ cCONFIDENCE.prototype.Calculate = function ( arg ) {
return this.value = new cNumber( gaussinv( 1.0 - alpha.getValue() / 2.0 ) * stdev_sigma.getValue() / Math.sqrt( size.getValue() ) ); return this.value = new cNumber( gaussinv( 1.0 - alpha.getValue() / 2.0 ) * stdev_sigma.getValue() / Math.sqrt( size.getValue() ) );
} };
cCONFIDENCE.prototype.getInfo = function () { cCONFIDENCE.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( alpha , standard-dev , size )" args:"( alpha , standard-dev , size )"
}; };
} };
function cCORREL() { function cCORREL() {
// cBaseFunction.call( this, "CORREL" ); // cBaseFunction.call( this, "CORREL" );
...@@ -895,7 +884,7 @@ function cCORREL() { ...@@ -895,7 +884,7 @@ function cCORREL() {
} }
cCORREL.prototype = Object.create( cBaseFunction.prototype ) cCORREL.prototype = Object.create( cBaseFunction.prototype );
cCORREL.prototype.Calculate = function ( arg ) { cCORREL.prototype.Calculate = function ( arg ) {
function correl( x, y ) { function correl( x, y ) {
...@@ -961,13 +950,13 @@ cCORREL.prototype.Calculate = function ( arg ) { ...@@ -961,13 +950,13 @@ cCORREL.prototype.Calculate = function ( arg ) {
return this.value = correl( arr0, arr1 ); return this.value = correl( arr0, arr1 );
} };
cCORREL.prototype.getInfo = function () { cCORREL.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( array-1 , array-2 )" args:"( array-1 , array-2 )"
}; };
} };
function cCOUNT() { function cCOUNT() {
// cBaseFunction.call( this, "COUNT" ); // cBaseFunction.call( this, "COUNT" );
...@@ -1112,7 +1101,7 @@ function cCOUNTBLANK() { ...@@ -1112,7 +1101,7 @@ function cCOUNTBLANK() {
} }
cCOUNTBLANK.prototype = Object.create( cBaseFunction.prototype ) cCOUNTBLANK.prototype = Object.create( cBaseFunction.prototype );
cCOUNTBLANK.prototype.Calculate = function ( arg ) { cCOUNTBLANK.prototype.Calculate = function ( arg ) {
var arg0 = arg[0]; var arg0 = arg[0];
if ( arg0 instanceof cArea || arg0 instanceof cArea3D ) if ( arg0 instanceof cArea || arg0 instanceof cArea3D )
...@@ -1122,13 +1111,13 @@ cCOUNTBLANK.prototype.Calculate = function ( arg ) { ...@@ -1122,13 +1111,13 @@ cCOUNTBLANK.prototype.Calculate = function ( arg ) {
} }
else else
return this.value = new cError( cErrorType.bad_reference ); return this.value = new cError( cErrorType.bad_reference );
} };
cCOUNTBLANK.prototype.getInfo = function () { cCOUNTBLANK.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( argument-list )" args:"( argument-list )"
}; };
} };
function cCOUNTIF() { function cCOUNTIF() {
// cBaseFunction.call( this, "COUNTIF" ); // cBaseFunction.call( this, "COUNTIF" );
...@@ -1149,7 +1138,7 @@ function cCOUNTIF() { ...@@ -1149,7 +1138,7 @@ function cCOUNTIF() {
} }
cCOUNTIF.prototype = Object.create( cBaseFunction.prototype ) cCOUNTIF.prototype = Object.create( cBaseFunction.prototype );
cCOUNTIF.prototype.Calculate = function ( arg ) { cCOUNTIF.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], _count = 0, valueForSearching; var arg0 = arg[0], arg1 = arg[1], _count = 0, valueForSearching;
if ( !(arg0 instanceof cRef || arg0 instanceof cRef3D || arg0 instanceof cArea || arg0 instanceof cArea3D) ) { if ( !(arg0 instanceof cRef || arg0 instanceof cRef3D || arg0 instanceof cArea || arg0 instanceof cArea3D) ) {
...@@ -1198,19 +1187,19 @@ cCOUNTIF.prototype.Calculate = function ( arg ) { ...@@ -1198,19 +1187,19 @@ cCOUNTIF.prototype.Calculate = function ( arg ) {
} }
return this.value = new cNumber( _count ); return this.value = new cNumber( _count );
} };
cCOUNTIF.prototype.getInfo = function () { cCOUNTIF.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( cell-range, selection-criteria )" args:"( cell-range, selection-criteria )"
}; };
} };
function cCOUNTIFS() { function cCOUNTIFS() {
cBaseFunction.call( this, "COUNTIFS" ); cBaseFunction.call( this, "COUNTIFS" );
} }
cCOUNTIFS.prototype = Object.create( cBaseFunction.prototype ) cCOUNTIFS.prototype = Object.create( cBaseFunction.prototype );
function cCOVAR() { function cCOVAR() {
// cBaseFunction.call( this, "COVAR" ); // cBaseFunction.call( this, "COVAR" );
...@@ -1231,7 +1220,7 @@ function cCOVAR() { ...@@ -1231,7 +1220,7 @@ function cCOVAR() {
} }
cCOVAR.prototype = Object.create( cBaseFunction.prototype ) cCOVAR.prototype = Object.create( cBaseFunction.prototype );
cCOVAR.prototype.Calculate = function ( arg ) { cCOVAR.prototype.Calculate = function ( arg ) {
function covar( x, y ) { function covar( x, y ) {
...@@ -1292,13 +1281,13 @@ cCOVAR.prototype.Calculate = function ( arg ) { ...@@ -1292,13 +1281,13 @@ cCOVAR.prototype.Calculate = function ( arg ) {
return this.value = covar( arr0, arr1 ); return this.value = covar( arr0, arr1 );
} };
cCOVAR.prototype.getInfo = function () { cCOVAR.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( array-1 , array-2 )" args:"( array-1 , array-2 )"
}; };
} };
function cCRITBINOM() { function cCRITBINOM() {
// cBaseFunction.call( this, "CRITBINOM" ); // cBaseFunction.call( this, "CRITBINOM" );
...@@ -1319,7 +1308,7 @@ function cCRITBINOM() { ...@@ -1319,7 +1308,7 @@ function cCRITBINOM() {
} }
cCRITBINOM.prototype = Object.create( cBaseFunction.prototype ) cCRITBINOM.prototype = Object.create( cBaseFunction.prototype );
cCRITBINOM.prototype.Calculate = function ( arg ) { cCRITBINOM.prototype.Calculate = function ( arg ) {
var n = arg[0], p = arg[1], alpha = arg[2]; // alpha var n = arg[0], p = arg[1], alpha = arg[2]; // alpha
...@@ -1386,13 +1375,13 @@ cCRITBINOM.prototype.Calculate = function ( arg ) { ...@@ -1386,13 +1375,13 @@ cCRITBINOM.prototype.Calculate = function ( arg ) {
return this.value = critbinom( n, p, alpha ); return this.value = critbinom( n, p, alpha );
} };
cCRITBINOM.prototype.getInfo = function () { cCRITBINOM.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( number-trials , success-probability , alpha )" args:"( number-trials , success-probability , alpha )"
}; };
} };
function cDEVSQ() { function cDEVSQ() {
// cBaseFunction.call( this, "DEVSQ" ); // cBaseFunction.call( this, "DEVSQ" );
...@@ -1413,7 +1402,7 @@ function cDEVSQ() { ...@@ -1413,7 +1402,7 @@ function cDEVSQ() {
} }
cDEVSQ.prototype = Object.create( cBaseFunction.prototype ) cDEVSQ.prototype = Object.create( cBaseFunction.prototype );
cDEVSQ.prototype.Calculate = function ( arg ) { cDEVSQ.prototype.Calculate = function ( arg ) {
function devsq( x ) { function devsq( x ) {
...@@ -1474,13 +1463,13 @@ cDEVSQ.prototype.Calculate = function ( arg ) { ...@@ -1474,13 +1463,13 @@ cDEVSQ.prototype.Calculate = function ( arg ) {
} }
return this.value = devsq( arr0 ); return this.value = devsq( arr0 );
} };
cDEVSQ.prototype.getInfo = function () { cDEVSQ.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( argument-list )" args:"( argument-list )"
}; };
} };
function cEXPONDIST() { function cEXPONDIST() {
// cBaseFunction.call( this, "EXPONDIST" ); // cBaseFunction.call( this, "EXPONDIST" );
...@@ -1501,7 +1490,7 @@ function cEXPONDIST() { ...@@ -1501,7 +1490,7 @@ function cEXPONDIST() {
} }
cEXPONDIST.prototype = Object.create( cBaseFunction.prototype ) cEXPONDIST.prototype = Object.create( cBaseFunction.prototype );
cEXPONDIST.prototype.Calculate = function ( arg ) { cEXPONDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3];
...@@ -1542,25 +1531,25 @@ cEXPONDIST.prototype.Calculate = function ( arg ) { ...@@ -1542,25 +1531,25 @@ cEXPONDIST.prototype.Calculate = function ( arg ) {
} }
else else
return this.value = new cNumber( arg1.getValue() * Math.exp( -arg1.getValue() * arg0.getValue() ) ); return this.value = new cNumber( arg1.getValue() * Math.exp( -arg1.getValue() * arg0.getValue() ) );
} };
cEXPONDIST.prototype.getInfo = function () { cEXPONDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( x , lambda , cumulative-flag )" args:"( x , lambda , cumulative-flag )"
}; };
} };
function cFDIST() { function cFDIST() {
cBaseFunction.call( this, "FDIST" ); cBaseFunction.call( this, "FDIST" );
} }
cFDIST.prototype = Object.create( cBaseFunction.prototype ) cFDIST.prototype = Object.create( cBaseFunction.prototype );
function cFINV() { function cFINV() {
cBaseFunction.call( this, "FINV" ); cBaseFunction.call( this, "FINV" );
} }
cFINV.prototype = Object.create( cBaseFunction.prototype ) cFINV.prototype = Object.create( cBaseFunction.prototype );
function cFISHER() { function cFISHER() {
// cBaseFunction.call( this, "FISHER" ); // cBaseFunction.call( this, "FISHER" );
...@@ -1581,7 +1570,7 @@ function cFISHER() { ...@@ -1581,7 +1570,7 @@ function cFISHER() {
} }
cFISHER.prototype = Object.create( cBaseFunction.prototype ) cFISHER.prototype = Object.create( cBaseFunction.prototype );
cFISHER.prototype.Calculate = function ( arg ) { cFISHER.prototype.Calculate = function ( arg ) {
var arg0 = arg[0]; var arg0 = arg[0];
...@@ -1612,13 +1601,13 @@ cFISHER.prototype.Calculate = function ( arg ) { ...@@ -1612,13 +1601,13 @@ cFISHER.prototype.Calculate = function ( arg ) {
} }
return this.value = arg0; return this.value = arg0;
} };
cFISHER.prototype.getInfo = function () { cFISHER.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( number )" args:"( number )"
}; };
} };
function cFISHERINV() { function cFISHERINV() {
// cBaseFunction.call( this, "FISHERINV" ); // cBaseFunction.call( this, "FISHERINV" );
...@@ -1639,7 +1628,7 @@ function cFISHERINV() { ...@@ -1639,7 +1628,7 @@ function cFISHERINV() {
} }
cFISHERINV.prototype = Object.create( cBaseFunction.prototype ) cFISHERINV.prototype = Object.create( cBaseFunction.prototype );
cFISHERINV.prototype.Calculate = function ( arg ) { cFISHERINV.prototype.Calculate = function ( arg ) {
var arg0 = arg[0]; var arg0 = arg[0];
...@@ -1670,13 +1659,13 @@ cFISHERINV.prototype.Calculate = function ( arg ) { ...@@ -1670,13 +1659,13 @@ cFISHERINV.prototype.Calculate = function ( arg ) {
} }
return this.value = arg0; return this.value = arg0;
} };
cFISHERINV.prototype.getInfo = function () { cFISHERINV.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( number )" args:"( number )"
}; };
} };
function cFORECAST() { function cFORECAST() {
// cBaseFunction.call( this, "FORECAST" ); // cBaseFunction.call( this, "FORECAST" );
...@@ -1804,7 +1793,7 @@ function cFREQUENCY() { ...@@ -1804,7 +1793,7 @@ function cFREQUENCY() {
} }
cFREQUENCY.prototype = Object.create( cBaseFunction.prototype ) cFREQUENCY.prototype = Object.create( cBaseFunction.prototype );
cFREQUENCY.prototype.Calculate = function ( arg ) { cFREQUENCY.prototype.Calculate = function ( arg ) {
function frequency( A, B ) { function frequency( A, B ) {
...@@ -2073,7 +2062,7 @@ function cHARMEAN() { ...@@ -2073,7 +2062,7 @@ function cHARMEAN() {
} }
cHARMEAN.prototype = Object.create( cBaseFunction.prototype ) cHARMEAN.prototype = Object.create( cBaseFunction.prototype );
cHARMEAN.prototype.Calculate = function ( arg ) { cHARMEAN.prototype.Calculate = function ( arg ) {
function harmmean( x ) { function harmmean( x ) {
...@@ -2162,7 +2151,7 @@ function cHYPGEOMDIST() { ...@@ -2162,7 +2151,7 @@ function cHYPGEOMDIST() {
} }
cHYPGEOMDIST.prototype = Object.create( cBaseFunction.prototype ) cHYPGEOMDIST.prototype = Object.create( cBaseFunction.prototype );
cHYPGEOMDIST.prototype.Calculate = function ( arg ) { cHYPGEOMDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3];
...@@ -2216,13 +2205,13 @@ cHYPGEOMDIST.prototype.Calculate = function ( arg ) { ...@@ -2216,13 +2205,13 @@ cHYPGEOMDIST.prototype.Calculate = function ( arg ) {
return this.value = new cNumber( Math.binomCoeff( arg2.getValue(), arg0.getValue() ) * Math.binomCoeff( arg3.getValue() - arg2.getValue(), arg1.getValue() - arg0.getValue() ) / return this.value = new cNumber( Math.binomCoeff( arg2.getValue(), arg0.getValue() ) * Math.binomCoeff( arg3.getValue() - arg2.getValue(), arg1.getValue() - arg0.getValue() ) /
Math.binomCoeff( arg3.getValue(), arg1.getValue() ) ); Math.binomCoeff( arg3.getValue(), arg1.getValue() ) );
} };
cHYPGEOMDIST.prototype.getInfo = function () { cHYPGEOMDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( sample-successes , number-sample , population-successes , number-population )" args:"( sample-successes , number-sample , population-successes , number-population )"
}; };
} };
function cINTERCEPT() { function cINTERCEPT() {
// cBaseFunction.call( this, "INTERCEPT" ); // cBaseFunction.call( this, "INTERCEPT" );
...@@ -2243,7 +2232,7 @@ function cINTERCEPT() { ...@@ -2243,7 +2232,7 @@ function cINTERCEPT() {
} }
cINTERCEPT.prototype = Object.create( cBaseFunction.prototype ) cINTERCEPT.prototype = Object.create( cBaseFunction.prototype );
cINTERCEPT.prototype.Calculate = function ( arg ) { cINTERCEPT.prototype.Calculate = function ( arg ) {
function intercept( y, x ) { function intercept( y, x ) {
...@@ -2338,7 +2327,7 @@ function cKURT() { ...@@ -2338,7 +2327,7 @@ function cKURT() {
} }
cKURT.prototype = Object.create( cBaseFunction.prototype ) cKURT.prototype = Object.create( cBaseFunction.prototype );
cKURT.prototype.Calculate = function ( arg ) { cKURT.prototype.Calculate = function ( arg ) {
function kurt( x ) { function kurt( x ) {
...@@ -2438,7 +2427,7 @@ function cLARGE() { ...@@ -2438,7 +2427,7 @@ function cLARGE() {
} }
cLARGE.prototype = Object.create( cBaseFunction.prototype ) cLARGE.prototype = Object.create( cBaseFunction.prototype );
cLARGE.prototype.Calculate = function ( arg ) { cLARGE.prototype.Calculate = function ( arg ) {
function frequency( A, k ) { function frequency( A, k ) {
...@@ -2503,13 +2492,13 @@ function cLINEST() { ...@@ -2503,13 +2492,13 @@ function cLINEST() {
cBaseFunction.call( this, "LINEST" ); cBaseFunction.call( this, "LINEST" );
} }
cLINEST.prototype = Object.create( cBaseFunction.prototype ) cLINEST.prototype = Object.create( cBaseFunction.prototype );
function cLOGEST() { function cLOGEST() {
cBaseFunction.call( this, "LOGEST" ); cBaseFunction.call( this, "LOGEST" );
} }
cLOGEST.prototype = Object.create( cBaseFunction.prototype ) cLOGEST.prototype = Object.create( cBaseFunction.prototype );
function cLOGINV() { function cLOGINV() {
// cBaseFunction.call( this, "LOGINV" ); // cBaseFunction.call( this, "LOGINV" );
...@@ -2530,7 +2519,7 @@ function cLOGINV() { ...@@ -2530,7 +2519,7 @@ function cLOGINV() {
} }
cLOGINV.prototype = Object.create( cBaseFunction.prototype ) cLOGINV.prototype = Object.create( cBaseFunction.prototype );
cLOGINV.prototype.Calculate = function ( arg ) { cLOGINV.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
...@@ -2572,13 +2561,13 @@ cLOGINV.prototype.Calculate = function ( arg ) { ...@@ -2572,13 +2561,13 @@ cLOGINV.prototype.Calculate = function ( arg ) {
if ( arg2 instanceof cError ) return this.value = arg2; if ( arg2 instanceof cError ) return this.value = arg2;
return this.value = loginv( arg0.getValue(), arg1.getValue(), arg2.getValue() ); return this.value = loginv( arg0.getValue(), arg1.getValue(), arg2.getValue() );
} };
cLOGINV.prototype.getInfo = function () { cLOGINV.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( x , mean , standard-deviation )" args:"( x , mean , standard-deviation )"
}; };
} };
function cLOGNORMDIST() { function cLOGNORMDIST() {
// cBaseFunction.call( this, "LOGNORMDIST" ); // cBaseFunction.call( this, "LOGNORMDIST" );
...@@ -2599,7 +2588,7 @@ function cLOGNORMDIST() { ...@@ -2599,7 +2588,7 @@ function cLOGNORMDIST() {
} }
cLOGNORMDIST.prototype = Object.create( cBaseFunction.prototype ) cLOGNORMDIST.prototype = Object.create( cBaseFunction.prototype );
cLOGNORMDIST.prototype.Calculate = function ( arg ) { cLOGNORMDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
...@@ -2641,13 +2630,13 @@ cLOGNORMDIST.prototype.Calculate = function ( arg ) { ...@@ -2641,13 +2630,13 @@ cLOGNORMDIST.prototype.Calculate = function ( arg ) {
if ( arg2 instanceof cError ) return this.value = arg2; if ( arg2 instanceof cError ) return this.value = arg2;
return this.value = normdist( arg0.getValue(), arg1.getValue(), arg2.getValue() ); return this.value = normdist( arg0.getValue(), arg1.getValue(), arg2.getValue() );
} };
cLOGNORMDIST.prototype.getInfo = function () { cLOGNORMDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( x , mean , standard-deviation )" args:"( x , mean , standard-deviation )"
}; };
} };
function cMAX() { function cMAX() {
// cBaseFunction.call( this, "MAX" ); // cBaseFunction.call( this, "MAX" );
...@@ -2756,7 +2745,7 @@ function cMAXA() { ...@@ -2756,7 +2745,7 @@ function cMAXA() {
} }
cMAXA.prototype = Object.create( cBaseFunction.prototype ) cMAXA.prototype = Object.create( cBaseFunction.prototype );
cMAXA.prototype.Calculate = function ( arg ) { cMAXA.prototype.Calculate = function ( arg ) {
var argI, argIVal, max = Number.NEGATIVE_INFINITY; var argI, argIVal, max = Number.NEGATIVE_INFINITY;
for ( var i = 0; i < this.argumentsCurrent; i++ ) { for ( var i = 0; i < this.argumentsCurrent; i++ ) {
...@@ -2825,7 +2814,7 @@ cMAXA.prototype.getInfo = function () { ...@@ -2825,7 +2814,7 @@ cMAXA.prototype.getInfo = function () {
name:this.name, name:this.name,
args:"(number1, number2, ...)" args:"(number1, number2, ...)"
}; };
} };
function cMEDIAN() { function cMEDIAN() {
// cBaseFunction.call( this, "MEDIAN" ); // cBaseFunction.call( this, "MEDIAN" );
...@@ -2846,7 +2835,7 @@ function cMEDIAN() { ...@@ -2846,7 +2835,7 @@ function cMEDIAN() {
} }
cMEDIAN.prototype = Object.create( cBaseFunction.prototype ) cMEDIAN.prototype = Object.create( cBaseFunction.prototype );
cMEDIAN.prototype.Calculate = function ( arg ) { cMEDIAN.prototype.Calculate = function ( arg ) {
function median( x ) { function median( x ) {
...@@ -2932,7 +2921,7 @@ function cMIN() { ...@@ -2932,7 +2921,7 @@ function cMIN() {
} }
cMIN.prototype = Object.create( cBaseFunction.prototype ) cMIN.prototype = Object.create( cBaseFunction.prototype );
cMIN.prototype.Calculate = function ( arg ) { cMIN.prototype.Calculate = function ( arg ) {
var argI, argIVal, min = Number.POSITIVE_INFINITY; var argI, argIVal, min = Number.POSITIVE_INFINITY;
for ( var i = 0; i < this.argumentsCurrent; i++ ) { for ( var i = 0; i < this.argumentsCurrent; i++ ) {
...@@ -3000,7 +2989,7 @@ cMIN.prototype.getInfo = function () { ...@@ -3000,7 +2989,7 @@ cMIN.prototype.getInfo = function () {
name:this.name, name:this.name,
args:"(number1, number2, ...)" args:"(number1, number2, ...)"
}; };
} };
function cMINA() { function cMINA() {
// cBaseFunction.call( this, "MINA" ); // cBaseFunction.call( this, "MINA" );
...@@ -3021,7 +3010,7 @@ function cMINA() { ...@@ -3021,7 +3010,7 @@ function cMINA() {
} }
cMINA.prototype = Object.create( cBaseFunction.prototype ) cMINA.prototype = Object.create( cBaseFunction.prototype );
cMINA.prototype.Calculate = function ( arg ) { cMINA.prototype.Calculate = function ( arg ) {
var argI, argIVal, min = Number.POSITIVE_INFINITY; var argI, argIVal, min = Number.POSITIVE_INFINITY;
for ( var i = 0; i < this.argumentsCurrent; i++ ) { for ( var i = 0; i < this.argumentsCurrent; i++ ) {
...@@ -3092,7 +3081,7 @@ cMINA.prototype.getInfo = function () { ...@@ -3092,7 +3081,7 @@ cMINA.prototype.getInfo = function () {
name:this.name, name:this.name,
args:"(number1, number2, ...)" args:"(number1, number2, ...)"
}; };
} };
function cMODE() { function cMODE() {
// cBaseFunction.call( this, "MODE" ); // cBaseFunction.call( this, "MODE" );
...@@ -3113,7 +3102,7 @@ function cMODE() { ...@@ -3113,7 +3102,7 @@ function cMODE() {
} }
cMODE.prototype = Object.create( cBaseFunction.prototype ) cMODE.prototype = Object.create( cBaseFunction.prototype );
cMODE.prototype.Calculate = function ( arg ) { cMODE.prototype.Calculate = function ( arg ) {
function mode( x ) { function mode( x ) {
...@@ -3219,7 +3208,7 @@ function cNEGBINOMDIST() { ...@@ -3219,7 +3208,7 @@ function cNEGBINOMDIST() {
} }
cNEGBINOMDIST.prototype = Object.create( cBaseFunction.prototype ) cNEGBINOMDIST.prototype = Object.create( cBaseFunction.prototype );
cNEGBINOMDIST.prototype.Calculate = function ( arg ) { cNEGBINOMDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
...@@ -3264,13 +3253,13 @@ cNEGBINOMDIST.prototype.Calculate = function ( arg ) { ...@@ -3264,13 +3253,13 @@ cNEGBINOMDIST.prototype.Calculate = function ( arg ) {
return this.value = negbinomdist( arg0, arg1, arg2 ); return this.value = negbinomdist( arg0, arg1, arg2 );
} };
cNEGBINOMDIST.prototype.getInfo = function () { cNEGBINOMDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( number-failures , number-successes , success-probability )" args:"( number-failures , number-successes , success-probability )"
}; };
} };
function cNORMDIST() { function cNORMDIST() {
// cBaseFunction.call( this, "NORMDIST" ); // cBaseFunction.call( this, "NORMDIST" );
...@@ -3291,7 +3280,7 @@ function cNORMDIST() { ...@@ -3291,7 +3280,7 @@ function cNORMDIST() {
} }
cNORMDIST.prototype = Object.create( cBaseFunction.prototype ) cNORMDIST.prototype = Object.create( cBaseFunction.prototype );
cNORMDIST.prototype.Calculate = function ( arg ) { cNORMDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3];
...@@ -3347,13 +3336,13 @@ cNORMDIST.prototype.Calculate = function ( arg ) { ...@@ -3347,13 +3336,13 @@ cNORMDIST.prototype.Calculate = function ( arg ) {
return this.value = normdist( arg0.getValue(), arg1.getValue(), arg2.getValue(), arg3.toBool() ); return this.value = normdist( arg0.getValue(), arg1.getValue(), arg2.getValue(), arg3.toBool() );
} };
cNORMDIST.prototype.getInfo = function () { cNORMDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( x , mean , standard-deviation , cumulative-flag )" args:"( x , mean , standard-deviation , cumulative-flag )"
}; };
} };
function cNORMINV() { function cNORMINV() {
// cBaseFunction.call( this, "NORMINV" ); // cBaseFunction.call( this, "NORMINV" );
...@@ -3374,7 +3363,7 @@ function cNORMINV() { ...@@ -3374,7 +3363,7 @@ function cNORMINV() {
} }
cNORMINV.prototype = Object.create( cBaseFunction.prototype ) cNORMINV.prototype = Object.create( cBaseFunction.prototype );
cNORMINV.prototype.Calculate = function ( arg ) { cNORMINV.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2]; var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
...@@ -3416,13 +3405,13 @@ cNORMINV.prototype.Calculate = function ( arg ) { ...@@ -3416,13 +3405,13 @@ cNORMINV.prototype.Calculate = function ( arg ) {
if ( arg2 instanceof cError ) return this.value = arg2; if ( arg2 instanceof cError ) return this.value = arg2;
return this.value = norminv( arg0.getValue(), arg1.getValue(), arg2.getValue() ); return this.value = norminv( arg0.getValue(), arg1.getValue(), arg2.getValue() );
} };
cNORMINV.prototype.getInfo = function () { cNORMINV.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( x , mean , standard-deviation )" args:"( x , mean , standard-deviation )"
}; };
} };
function cNORMSDIST() { function cNORMSDIST() {
// cBaseFunction.call( this, "NORMSDIST" ); // cBaseFunction.call( this, "NORMSDIST" );
...@@ -3443,7 +3432,7 @@ function cNORMSDIST() { ...@@ -3443,7 +3432,7 @@ function cNORMSDIST() {
} }
cNORMSDIST.prototype = Object.create( cBaseFunction.prototype ) cNORMSDIST.prototype = Object.create( cBaseFunction.prototype );
cNORMSDIST.prototype.Calculate = function ( arg ) { cNORMSDIST.prototype.Calculate = function ( arg ) {
var arg0 = arg[0]; var arg0 = arg[0];
if ( arg0 instanceof cArea || arg0 instanceof cArea3D ) { if ( arg0 instanceof cArea || arg0 instanceof cArea3D ) {
...@@ -3468,13 +3457,13 @@ cNORMSDIST.prototype.Calculate = function ( arg ) { ...@@ -3468,13 +3457,13 @@ cNORMSDIST.prototype.Calculate = function ( arg ) {
return this.value = isNaN( a ) ? new cError( cErrorType.not_numeric ) : new cNumber( a ); return this.value = isNaN( a ) ? new cError( cErrorType.not_numeric ) : new cNumber( a );
} }
return this.value = arg0; return this.value = arg0;
} };
cNORMSDIST.prototype.getInfo = function () { cNORMSDIST.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"(number)" args:"(number)"
}; };
} };
function cNORMSINV() { function cNORMSINV() {
// cBaseFunction.call( this, "NORMSINV" ); // cBaseFunction.call( this, "NORMSINV" );
...@@ -3495,7 +3484,7 @@ function cNORMSINV() { ...@@ -3495,7 +3484,7 @@ function cNORMSINV() {
} }
cNORMSINV.prototype = Object.create( cBaseFunction.prototype ) cNORMSINV.prototype = Object.create( cBaseFunction.prototype );
cNORMSINV.prototype.Calculate = function ( arg ) { cNORMSINV.prototype.Calculate = function ( arg ) {
function normsinv( x ) { function normsinv( x ) {
...@@ -3528,13 +3517,13 @@ cNORMSINV.prototype.Calculate = function ( arg ) { ...@@ -3528,13 +3517,13 @@ cNORMSINV.prototype.Calculate = function ( arg ) {
return this.value = isNaN( a ) ? new cError( cErrorType.not_available ) : new cNumber( a ); return this.value = isNaN( a ) ? new cError( cErrorType.not_available ) : new cNumber( a );
} }
return this.value = arg0; return this.value = arg0;
} };
cNORMSINV.prototype.getInfo = function () { cNORMSINV.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( probability )" args:"( probability )"
}; };
} };
function cPEARSON() { function cPEARSON() {
// cBaseFunction.call( this, "PEARSON" ); // cBaseFunction.call( this, "PEARSON" );
...@@ -3555,7 +3544,7 @@ function cPEARSON() { ...@@ -3555,7 +3544,7 @@ function cPEARSON() {
} }
cPEARSON.prototype = Object.create( cBaseFunction.prototype ) cPEARSON.prototype = Object.create( cBaseFunction.prototype );
cPEARSON.prototype.Calculate = function ( arg ) { cPEARSON.prototype.Calculate = function ( arg ) {
function pearson( x, y ) { function pearson( x, y ) {
...@@ -3650,7 +3639,7 @@ function cPERCENTILE() { ...@@ -3650,7 +3639,7 @@ function cPERCENTILE() {
} }
cPERCENTILE.prototype = Object.create( cBaseFunction.prototype ) cPERCENTILE.prototype = Object.create( cBaseFunction.prototype );
cPERCENTILE.prototype.Calculate = function ( arg ) { cPERCENTILE.prototype.Calculate = function ( arg ) {
function percentile( A, k ) { function percentile( A, k ) {
...@@ -3723,7 +3712,7 @@ cPERCENTILE.prototype.getInfo = function () { ...@@ -3723,7 +3712,7 @@ cPERCENTILE.prototype.getInfo = function () {
name:this.name, name:this.name,
args:"( array , k )" args:"( array , k )"
}; };
} };
function cPERCENTRANK() { function cPERCENTRANK() {
// cBaseFunction.call( this, "PERCENTRANK" ); // cBaseFunction.call( this, "PERCENTRANK" );
...@@ -3744,7 +3733,7 @@ function cPERCENTRANK() { ...@@ -3744,7 +3733,7 @@ function cPERCENTRANK() {
} }
cPERCENTRANK.prototype = Object.create( cBaseFunction.prototype ) cPERCENTRANK.prototype = Object.create( cBaseFunction.prototype );
cPERCENTRANK.prototype.Calculate = function ( arg ) { cPERCENTRANK.prototype.Calculate = function ( arg ) {
function percentrank( A, x, k ) { function percentrank( A, x, k ) {
...@@ -3840,13 +3829,13 @@ cPERCENTRANK.prototype.Calculate = function ( arg ) { ...@@ -3840,13 +3829,13 @@ cPERCENTRANK.prototype.Calculate = function ( arg ) {
return this.value = percentrank( arr0, arg1, arg2 ); return this.value = percentrank( arr0, arg1, arg2 );
} };
cPERCENTRANK.prototype.getInfo = function () { cPERCENTRANK.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( array , x [ , significance ] )" args:"( array , x [ , significance ] )"
}; };
} };
function cPERMUT() { function cPERMUT() {
// cBaseFunction.call( this, "PERMUT" ); // cBaseFunction.call( this, "PERMUT" );
...@@ -3867,7 +3856,7 @@ function cPERMUT() { ...@@ -3867,7 +3856,7 @@ function cPERMUT() {
} }
cPERMUT.prototype = Object.create( cBaseFunction.prototype ) cPERMUT.prototype = Object.create( cBaseFunction.prototype );
cPERMUT.prototype.Calculate = function ( arg ) { cPERMUT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1]; var arg0 = arg[0], arg1 = arg[1];
if ( arg0 instanceof cArea || arg0 instanceof cArea3D ) { if ( arg0 instanceof cArea || arg0 instanceof cArea3D ) {
...@@ -3937,13 +3926,13 @@ cPERMUT.prototype.Calculate = function ( arg ) { ...@@ -3937,13 +3926,13 @@ cPERMUT.prototype.Calculate = function ( arg ) {
return this.value = new cError( cErrorType.not_numeric ); return this.value = new cError( cErrorType.not_numeric );
return this.value = new cNumber( Math.permut( arg0.getValue(), arg1.getValue() ) ); return this.value = new cNumber( Math.permut( arg0.getValue(), arg1.getValue() ) );
} };
cPERMUT.prototype.getInfo = function () { cPERMUT.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( number , number-chosen )" args:"( number , number-chosen )"
}; };
} };
function cPOISSON() { function cPOISSON() {
// cBaseFunction.call( this, "POISSON" ); // cBaseFunction.call( this, "POISSON" );
...@@ -3964,7 +3953,7 @@ function cPOISSON() { ...@@ -3964,7 +3953,7 @@ function cPOISSON() {
} }
cPOISSON.prototype = Object.create( cBaseFunction.prototype ) cPOISSON.prototype = Object.create( cBaseFunction.prototype );
cPOISSON.prototype.Calculate = function ( arg ) { cPOISSON.prototype.Calculate = function ( arg ) {
function poisson( x, l, cumulativeFlag ) { function poisson( x, l, cumulativeFlag ) {
...@@ -4020,13 +4009,13 @@ cPOISSON.prototype.Calculate = function ( arg ) { ...@@ -4020,13 +4009,13 @@ cPOISSON.prototype.Calculate = function ( arg ) {
return this.value = new cNumber( poisson( arg0, arg1, arg2 ) ); return this.value = new cNumber( poisson( arg0, arg1, arg2 ) );
} };
cPOISSON.prototype.getInfo = function () { cPOISSON.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( x , mean , cumulative-flag )" args:"( x , mean , cumulative-flag )"
}; };
} };
function cPROB() { function cPROB() {
// cBaseFunction.call( this, "PROB" ); // cBaseFunction.call( this, "PROB" );
...@@ -4048,7 +4037,7 @@ function cPROB() { ...@@ -4048,7 +4037,7 @@ function cPROB() {
} }
cPROB.prototype = Object.create( cBaseFunction.prototype ) cPROB.prototype = Object.create( cBaseFunction.prototype );
cPROB.prototype.Calculate = function ( arg ) { cPROB.prototype.Calculate = function ( arg ) {
function prob( x, p, l, u ) { function prob( x, p, l, u ) {
...@@ -4169,7 +4158,7 @@ function cQUARTILE() { ...@@ -4169,7 +4158,7 @@ function cQUARTILE() {
} }
cQUARTILE.prototype = Object.create( cBaseFunction.prototype ) cQUARTILE.prototype = Object.create( cBaseFunction.prototype );
cQUARTILE.prototype.Calculate = function ( arg ) { cQUARTILE.prototype.Calculate = function ( arg ) {
function quartile( A, k ) { function quartile( A, k ) {
...@@ -4826,7 +4815,7 @@ function cSTDEVA() { ...@@ -4826,7 +4815,7 @@ function cSTDEVA() {
} }
cSTDEVA.prototype = Object.create( cBaseFunction.prototype ) cSTDEVA.prototype = Object.create( cBaseFunction.prototype );
cSTDEVA.prototype.Calculate = function ( arg ) { cSTDEVA.prototype.Calculate = function ( arg ) {
var count = 0, sum = new cNumber( 0 ), member = []; var count = 0, sum = new cNumber( 0 ), member = [];
for ( var i = 0; i < arg.length; i++ ) { for ( var i = 0; i < arg.length; i++ ) {
...@@ -4991,7 +4980,7 @@ function cSTDEVPA() { ...@@ -4991,7 +4980,7 @@ function cSTDEVPA() {
} }
cSTDEVPA.prototype = Object.create( cBaseFunction.prototype ) cSTDEVPA.prototype = Object.create( cBaseFunction.prototype );
cSTDEVPA.prototype.Calculate = function ( arg ) { cSTDEVPA.prototype.Calculate = function ( arg ) {
function _var( x ) { function _var( x ) {
...@@ -5100,7 +5089,7 @@ function cSTEYX() { ...@@ -5100,7 +5089,7 @@ function cSTEYX() {
} }
cSTEYX.prototype = Object.create( cBaseFunction.prototype ) cSTEYX.prototype = Object.create( cBaseFunction.prototype );
cSTEYX.prototype.Calculate = function ( arg ) { cSTEYX.prototype.Calculate = function ( arg ) {
function steyx( y, x ) { function steyx( y, x ) {
...@@ -5181,19 +5170,19 @@ function cTDIST() { ...@@ -5181,19 +5170,19 @@ function cTDIST() {
cBaseFunction.call( this, "TDIST" ); cBaseFunction.call( this, "TDIST" );
} }
cTDIST.prototype = Object.create( cBaseFunction.prototype ) cTDIST.prototype = Object.create( cBaseFunction.prototype );
function cTINV() { function cTINV() {
cBaseFunction.call( this, "TINV" ); cBaseFunction.call( this, "TINV" );
} }
cTINV.prototype = Object.create( cBaseFunction.prototype ) cTINV.prototype = Object.create( cBaseFunction.prototype );
function cTREND() { function cTREND() {
cBaseFunction.call( this, "TREND" ); cBaseFunction.call( this, "TREND" );
} }
cTREND.prototype = Object.create( cBaseFunction.prototype ) cTREND.prototype = Object.create( cBaseFunction.prototype );
function cTRIMMEAN() { function cTRIMMEAN() {
cBaseFunction.call( this, "TRIMMEAN" ); cBaseFunction.call( this, "TRIMMEAN" );
......
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