From b617951daf1ed70ca8b6c9fe5f11d3213c768645 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 15 Feb 2022 19:31:45 +1100 Subject: [PATCH] neatogen max_abs: replace open coded max with a call to 'fmax' --- lib/neatogen/matrix_ops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/neatogen/matrix_ops.c b/lib/neatogen/matrix_ops.c index 60db51d95..fca595e87 100644 --- a/lib/neatogen/matrix_ops.c +++ b/lib/neatogen/matrix_ops.c @@ -424,8 +424,7 @@ double max_abs(int n, double *vector) double max_val = -1e50; int i; for (i = 0; i < n; i++) - if (fabs(vector[i]) > max_val) - max_val = fabs(vector[i]); + max_val = fmax(max_val, fabs(vector[i])); return max_val; } -- 2.40.0