From a7f3321d93ecdb8279d07c2a9433d423c8d36f57 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 11 Sep 2021 10:10:42 -0700 Subject: [PATCH] lu_decompose: rephrase comparisons against 'biggest' to avoid equals This squashes some -Wfloat-equal warnings, but has the same effect due to the surrounding code ensuring `biggest` can only ever increase from 0. --- lib/neatogen/lu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/neatogen/lu.c b/lib/neatogen/lu.c index e0e013ae9..b18125fe7 100644 --- a/lib/neatogen/lu.c +++ b/lib/neatogen/lu.c @@ -80,7 +80,7 @@ int lu_decompose(double **a, int n) biggest = 0.0; for (j = 0; j < n; j++) biggest = fmax(biggest, fabs(lu[i][j] = a[i][j])); - if (biggest != 0.0) + if (biggest > 0.0) scales[i] = 1.0 / biggest; else { scales[i] = 0.0; @@ -98,7 +98,7 @@ int lu_decompose(double **a, int n) pivotindex = i; } } - if (biggest == 0.0) + if (biggest <= 0.0) return (0); /* Zero column: singular matrix */ if (pivotindex != k) { /* Update pivot sequence */ j = ps[k]; -- 2.40.0