From c3d02719be706020e488fa2f052b34f433d5c91c Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 15 Feb 2022 19:32:10 +1100 Subject: [PATCH] neatogen max_absf: replace open coded max with a call to 'fmaxf' --- 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 fca595e87..ad33e0dd0 100644 --- a/lib/neatogen/matrix_ops.c +++ b/lib/neatogen/matrix_ops.c @@ -583,8 +583,7 @@ double max_absf(int n, float *vector) int i; float max_val = -1e30f; for (i = 0; i < n; i++) - if (fabs(vector[i]) > max_val) - max_val = fabsf(vector[i]); + max_val = fmaxf(max_val, fabsf(vector[i])); return max_val; } -- 2.40.0