From: erg Date: Wed, 29 Sep 2010 20:30:27 +0000 (+0000) Subject: Remove use of fabs() as this is still buggy in gcc. X-Git-Tag: LAST_LIBGRAPH~32^2~1182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bb76d5d78f5108b2845f4a8bc9a2544e605ec38;p=graphviz Remove use of fabs() as this is still buggy in gcc. --- diff --git a/lib/neatogen/stress.c b/lib/neatogen/stress.c index 41710da63..72e135115 100644 --- a/lib/neatogen/stress.c +++ b/lib/neatogen/stress.c @@ -1841,9 +1841,11 @@ int stress_majorization_kD_mkernel(vtx_data * graph, /* Input graph in sparse re /* Invariant: old_stress > 0. In theory, old_stress >= new_stress * but we use fabs in case of numerical error. */ - converged = - (((fabs(old_stress - new_stress) / old_stress) < Epsilon) - || (new_stress < Epsilon)); + { + double diff = old_stress - new_stress; + double change = ABS(diff); + converged = (((change / old_stress) < Epsilon) || (new_stress < Epsilon)); + } old_stress = new_stress; for (k = 0; k < dim; k++) {