diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index dc2a1641..098c49c7 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -681,7 +681,9 @@ namespace Clipper2Lib // returns true if (and only if) a * b == c * d inline bool ProductsAreEqual(int64_t a, int64_t b, int64_t c, int64_t d) { - // nb: unsigned values will be needed for CalcOverflowCarry() + // nb: unsigned values will be needed for CalcOverflowCarry(), and also + // for the straightforward multiplication itself because signed + // arithmetic overflow is undefined behavior const auto abs_a = static_cast(std::abs(a)); const auto abs_b = static_cast(std::abs(b)); const auto abs_c = static_cast(std::abs(c));