We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99d4e89 commit 1ff139bCopy full SHA for 1ff139b
port/cpl_float.cpp
@@ -445,9 +445,11 @@ double CPLGreatestCommonDivisor(double a, double b)
445
446
const auto common_num = std::gcd(num_a, num_b);
447
448
- // coverity[divide_by_zero]
+ // Add std::numeric_limits<double>::min() to avoid Coverity Scan warning
449
+ // about div by zero
450
const auto common = sign * static_cast<double>(common_num) /
- static_cast<double>(common_denom);
451
+ (static_cast<double>(common_denom) +
452
+ std::numeric_limits<double>::min());
453
454
const auto disaggregation_factor = std::max(a / common, b / common);
455
if (disaggregation_factor > 10000)
0 commit comments