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

fix: Bug 21135 - Ошибка при вычислении количества строк в функции ROWS

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50505 954022d7-b5bf-4e40-9824-e11837661b57
parent 95f82a0e
...@@ -3067,12 +3067,19 @@ parserFormula.prototype = { ...@@ -3067,12 +3067,19 @@ parserFormula.prototype = {
for ( var i = 0; i < this.outStack.length; i++ ) { for ( var i = 0; i < this.outStack.length; i++ ) {
var ref = this.outStack[i]; var ref = this.outStack[i];
if ( ref instanceof cName ) { if ( ref instanceof cName ) {
ref = ref.toRef( this.ws.getId() ); ref = ref.toRef( this.ws.getId() );
if ( ref instanceof cError ) if ( ref instanceof cError )
continue; continue;
} }
if ( (ref instanceof cRef || ref instanceof cRef3D || ref instanceof cArea || ref instanceof cArea3D) && ref.isValid() &&
this.outStack[i + 1] && this.outStack[i + 1] instanceof cBaseFunction && this.outStack[i + 1].name == "ROWS" ) {
continue;
}
if ( (ref instanceof cRef || ref instanceof cRef3D || ref instanceof cArea) && ref.isValid() ) { if ( (ref instanceof cRef || ref instanceof cRef3D || ref instanceof cArea) && ref.isValid() ) {
var nFrom = new Vertex( this.ws.Id, this.cellId.replace( /\$/g, "" ), this.wb ), var nFrom = new Vertex( this.ws.Id, this.cellId.replace( /\$/g, "" ), this.wb ),
nTo = new Vertex( ref.getWsId(), ref._cells.replace( /\$/g, "" ), this.wb ); nTo = new Vertex( ref.getWsId(), ref._cells.replace( /\$/g, "" ), this.wb );
...@@ -3569,21 +3576,18 @@ function rtl_math_erf( x ) { ...@@ -3569,21 +3576,18 @@ function rtl_math_erf( x ) {
return fErf; return fErf;
} }
function rtl_math_erfc( x ) function rtl_math_erfc( x ) {
{
if ( x == 0.0 ) if ( x == 0.0 )
return 1.0; return 1.0;
var bNegative = false; var bNegative = false;
if ( x < 0.0 ) if ( x < 0.0 ) {
{
x = Math.abs( x ); x = Math.abs( x );
bNegative = true; bNegative = true;
} }
var fErfc = 0.0; var fErfc = 0.0;
if ( x >= 0.65 ) if ( x >= 0.65 ) {
{
if ( x < 6.0 ) if ( x < 6.0 )
fErfc = lcl_Erfc0600( x ); fErfc = lcl_Erfc0600( x );
else else
...@@ -3598,7 +3602,6 @@ function rtl_math_erfc( x ) ...@@ -3598,7 +3602,6 @@ function rtl_math_erfc( x )
return fErfc; return fErfc;
} }
function integralPhi( x ) function integralPhi( x ) { // Using gauss(x)+0.5 has severe cancellation errors for x<-4
{ // Using gauss(x)+0.5 has severe cancellation errors for x<-4 return 0.5 * rtl_math_erfc( -x * 0.7071067811865475 ); // * 1/sqrt(2)
return 0.5 * rtl_math_erfc(-x * 0.7071067811865475); // * 1/sqrt(2)
} }
\ No newline at end of file
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