]> granicus.if.org Git - graphviz/commitdiff
neatogen max_absf: replace open coded max with a call to 'fmaxf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 15 Feb 2022 08:32:10 +0000 (19:32 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 16 Feb 2022 10:08:58 +0000 (21:08 +1100)
lib/neatogen/matrix_ops.c

index fca595e879e4c500b983420444fabd89ad48cd82..ad33e0dd04fcdba8efb42484aeb4889ab439d732 100644 (file)
@@ -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;
 }