From 4e22cc35232dcc00a647d308c696bd7d3b79a15a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 15 Mar 2014 16:48:02 +0000 Subject: [PATCH] Fix hang during output of (7,6). I had rather hoped that GLPK would always output a min fragment slightly _less_ than the true rational value, on the basis that some of its minima would be slightly below the right value and some slightly above. Sadly, (7,6) consistently guesses high, so I must fall back to the usual 1e10 bodge to round to rationals. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 5850860..96f945c 100644 --- a/main.c +++ b/main.c @@ -796,7 +796,7 @@ static void report(void) { if (ai[i][j] > 0 && ai[i][j] < imin) imin = ai[i][j]; - if ((double)imin / d < min) + if (abs((double)imin / d - min) > 1e-10) goto next_d; /* -- 2.30.2