Skip to content

Commit

Permalink
Add helpful remark
Browse files Browse the repository at this point in the history
  • Loading branch information
reunanen committed May 12, 2024
1 parent be517cd commit 69f5d55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CPP/Clipper2Lib/include/clipper2/clipper.core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(std::abs(a));
const auto abs_b = static_cast<uint64_t>(std::abs(b));
const auto abs_c = static_cast<uint64_t>(std::abs(c));
Expand Down

0 comments on commit 69f5d55

Please sign in to comment.