From: eap Date: Mon, 16 Nov 2009 16:11:25 +0000 (+0000) Subject: 19296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh X-Git-Tag: V5_1_3rc3~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=29e9d54daeb4ec87433576ca94f4836ec6561d51;p=modules%2Fsmesh.git 19296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh protect ARITHMETIC_1D from FPE --- diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 8e50b059b..b2fee2046 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -757,7 +757,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, double an = _value[ END_LENGTH_IND ]; double q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 ); - int n = int( 1 + ( an - a1 ) / q ); + int n = fabs(q) > numeric_limits::min() ? int( 1 + ( an - a1 ) / q ) : 1+theLength/a1; double U1 = theReverse ? l : f; double Un = theReverse ? f : l;