From 29e9d54daeb4ec87433576ca94f4836ec6561d51 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 16 Nov 2009 16:11:25 +0000 Subject: [PATCH] 19296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh protect ARITHMETIC_1D from FPE --- src/StdMeshers/StdMeshers_Regular_1D.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2