From: Julien Schueller Date: Fri, 14 Dec 2018 04:15:45 +0000 (+0100) Subject: AUGLAG: Fix arithmetic exception (#242) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=sidebyside;h=3b081736ef129f00734040634182fa37929f00bd;p=nlopt.git AUGLAG: Fix arithmetic exception (#242) --- diff --git a/src/algs/auglag/auglag.c b/src/algs/auglag/auglag.c index 384194a..18e5e66 100644 --- a/src/algs/auglag/auglag.c +++ b/src/algs/auglag/auglag.c @@ -174,7 +174,7 @@ nlopt_result auglag_minimize(int n, nlopt_func f, void *f_data, *minf = fcur; minf_penalty = penalty; minf_feasible = feasible; - d.rho = MAX(1e-6, MIN(10, 2 * fabs(*minf) / con2)); + d.rho = (con2 > 0) ? MAX(1e-6, MIN(10, 2 * fabs(*minf) / con2)) : 10; } else d.rho = 1; /* whatever, doesn't matter */