]> granicus.if.org Git - graphviz/commitdiff
neatogen: replace float-casted calls to 'fabs' with calls to 'fabsf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 15 Feb 2022 08:22:55 +0000 (19:22 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 16 Feb 2022 10:08:58 +0000 (21:08 +1100)
This is simpler, more efficient, and clearer to the compiler.

lib/neatogen/matrix_ops.c

index d13ced562e3798608e97c86e60c009ee8201e2d4..417609b1dbfff1acad17514373cd541f1ebf74f8 100644 (file)
@@ -585,7 +585,7 @@ double max_absf(int n, float *vector)
     float max_val = -1e30f;
     for (i = 0; i < n; i++)
        if (fabs(vector[i]) > max_val)
-           max_val = (float) (fabs(vector[i]));
+           max_val = fabsf(vector[i]);
 
     return max_val;
 }