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

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