Commit 191f7113 authored by GoshaZotov's avatar GoshaZotov

add tests for FORECAST.ETS.STAT

parent f8e20c22
......@@ -4442,6 +4442,16 @@ $( function () {
strictEqual(oParser.calculate().getValue(), 12);
} );
test( "Test: \"FORECAST.ETS.STAT\"", function () {
//результаты данного теста соответсвуют результатам LO, но отличаются от MS!!!
putDataForForecastEts();
oParser = new parserFormula("FORECAST.ETS.STAT(B4:B60,A4:A60,1,1)", "A1", ws);
ok(oParser.parse());
strictEqual(oParser.calculate().getValue().toFixed( 8 ) - 0, 0.65234375);
} );
test( "Test: \"FORECAST.LINEAR\"", function () {
oParser = new parserFormula( "FORECAST(30,{6,7,9,15,21},{20,28,31,38,40})", "A1", ws );
ok( oParser.parse() );
......
......@@ -1301,6 +1301,19 @@
return new cNumber(res);
}
function convertToMatrix(val){
var matrix;
if(undefined !== val.getMatrix){
matrix = val.getMatrix();
}else {
val = val.tocNumber();
if(cElementType.error === val.type){
return val;
}
matrix = [[val]];
}
return matrix;
}
function GAMMADISTFUNCTION(fp, fAlpha, fBeta){
this.fp = fp;
......@@ -4732,8 +4745,7 @@
argClone[4] = argClone[4] ? argClone[4].tocNumber() : new cNumber(1);
argClone[5] = argClone[5] ? argClone[5].tocNumber() : new cNumber(1);
//TODO сделать функцию convertToMatrix!!!!
argClone[2] = argClone[2].getMatrix();
argClone[2] = convertToMatrix(argClone[2]);
var argError;
if (argError = this._checkErrorArg(argClone)) {
......
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