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

fix: Bug 14190 - Ошибка при округлении отрицательного числа вверх по...

fix: Bug 14190 - Ошибка при округлении отрицательного числа вверх по положительному множителю (CEILING) (http://bugzserver/show_bug.cgi?id=14190)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65074 954022d7-b5bf-4e40-9824-e11837661b57
parent 29c56a96
......@@ -565,7 +565,7 @@ cCEILING.prototype.Calculate = function ( arg ) {
function ceilingHelper( number, significance ) {
if ( significance == 0 )
return new cNumber( 0.0 );
if ( ( number > 0 && significance < 0 ) || ( number < 0 && significance > 0 ) )
if ( number > 0 && significance < 0 )
return new cError( cErrorType.not_numeric );
else if ( number / significance === Infinity )
return new cError( cErrorType.not_numeric );
......@@ -576,7 +576,7 @@ cCEILING.prototype.Calculate = function ( arg ) {
}
var quotientTr = Math.floor( quotient );
var nolpiat = 5 * ( quotient < 0 ? -1.0 : quotient > 0 ? 1.0 : 0.0 ) * Math.pow( 10, Math.floor( Math.log10( Math.abs( quotient ) ) ) - cExcelSignificantDigits );
var nolpiat = 5 * Math.sign(quotient) * Math.pow( 10, Math.floor( Math.log10( Math.abs( quotient ) ) ) - cExcelSignificantDigits );
if ( Math.abs( quotient - quotientTr ) > nolpiat ) {
++quotientTr;
......
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