Skip to content

Commit

Permalink
fix: fix a bug in igraph_cmp_epsilon(), also fixes #1894
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Dec 17, 2021
1 parent 1fdc09b commit 1031f3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/math/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int igraph_cmp_epsilon(double a, double b, double eps) {
diff = a - b;
abs_diff = fabs(diff);

if (a == 0 || b == 0 || diff < DBL_MIN) {
if (a == 0 || b == 0 || abs_diff < DBL_MIN) {
/* a or b is zero or both are extremely close to it; relative
* error is less meaningful here so just compare it with
* epsilon */
Expand Down

0 comments on commit 1031f3d

Please sign in to comment.