Commit 01c08718 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

поправлены ошибки в функциях FACDOUBLE, FIXED

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57723 954022d7-b5bf-4e40-9824-e11837661b57
parent 291a0dc0
...@@ -1105,8 +1105,15 @@ function cFACTDOUBLE() { ...@@ -1105,8 +1105,15 @@ function cFACTDOUBLE() {
cFACTDOUBLE.prototype = Object.create( cBaseFunction.prototype ) cFACTDOUBLE.prototype = Object.create( cBaseFunction.prototype )
cFACTDOUBLE.prototype.Calculate = function ( arg ) { cFACTDOUBLE.prototype.Calculate = function ( arg ) {
function factDouble( n ) { function factDouble( n ) {
if ( n < 0 ) return Number.NaN; if ( n == 0 ) {
else if ( n > 300 ) return Number.Infinity; return 0;
}
else if ( n < 0 ) {
return Number.NaN;
}
else if ( n > 300 ) {
return Number.Infinity;
}
n = Math.floor( n ); n = Math.floor( n );
var k = 1, res = n, _n = n, ost = -(_n & 1) var k = 1, res = n, _n = n, ost = -(_n & 1)
n -= 2 n -= 2
......
...@@ -734,6 +734,8 @@ cFIXED.prototype.Calculate = function ( arg ) { ...@@ -734,6 +734,8 @@ cFIXED.prototype.Calculate = function ( arg ) {
arg2 = arg2.cross( arguments[1].first ); arg2 = arg2.cross( arguments[1].first );
} }
arg2 = arg2.tocBool();
if ( arg0 instanceof cError ) return this.value = arg0; if ( arg0 instanceof cError ) return this.value = arg0;
if ( arg1 instanceof cError ) return this.value = arg1; if ( arg1 instanceof cError ) return this.value = arg1;
if ( arg2 instanceof cError ) return this.value = arg2; if ( arg2 instanceof cError ) return this.value = arg2;
......
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