From 8d3454072d0f68c780e28eb56111d4fe2f84736d Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 15 Jul 2014 16:51:58 +0200 Subject: [PATCH] CID#1169815 Division or modulo by float zero (DIVIDE_BY_ZERO) Change-Id: Id90a018645ae37be600f942a8391dd56ff156b68 --- sc/source/core/tool/interpr3.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index a94fe10038e9..0a3ac920992f 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -3596,7 +3596,7 @@ double ScInterpreter::GetPercentrank( ::std::vector & 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 & 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 ); }