This seems a more accurate definition of what overflow would mean under C99.
Though as far as I can tell, it is not possible to reach this code with negative
values in the array, so the `< 0` check is always false. The `>= FLT_MAX` is
true for both `FLT_MAX` itself as well as positive infinity.
* Contributors: Details at https://graphviz.org
*************************************************************************/
-
+#include <float.h>
#include <neatogen/neato.h>
#include <neatogen/dijkstra.h>
#include <neatogen/bfs.h>
invert_sqrt_vec(len, dist_accumulator);
/* detect overflows */
for (j = 0; j < len; j++) {
- if (dist_accumulator[j] >= MAXFLOAT
- || dist_accumulator[j] < 0) {
+ if (dist_accumulator[j] >= FLT_MAX || dist_accumulator[j] < 0) {
dist_accumulator[j] = 0;
}
}