CID#1169815 Division or modulo by float zero (DIVIDE_BY_ZERO)

Change-Id: Id90a018645ae37be600f942a8391dd56ff156b68
This commit is contained in:
Eike Rathke
2014-07-15 16:51:58 +02:00
parent 8930030323
commit 8d3454072d

View File

@@ -3596,7 +3596,7 @@ double ScInterpreter::GetPercentrank( ::std::vector<double> & rArray, double fVa
if ( fVal == rArray[ i ] )
{
if ( bInclusive )
fRes = ( double )nOldCount / ( double )( nSize - 1 );
fRes = div( nOldCount, nSize - 1 );
else
fRes = ( double )( i + 1 ) / ( double )( nSize + 1 );
}
@@ -3615,7 +3615,7 @@ double ScInterpreter::GetPercentrank( ::std::vector<double> & rArray, double fVa
double fFract = ( fVal - rArray[ nOldCount - 1 ] ) /
( rArray[ nOldCount ] - rArray[ nOldCount - 1 ] );
if ( bInclusive )
fRes = ( ( double )( nOldCount - 1 ) + fFract ) / ( double )( nSize - 1 );
fRes = div( ( double )( nOldCount - 1 ) + fFract, nSize - 1 );
else
fRes = ( ( double )nOldCount + fFract ) / ( double )( nSize + 1 );
}