Skip to content

Commit

Permalink
big_int: fix division
Browse files Browse the repository at this point in the history
  • Loading branch information
ioxid committed Dec 10, 2024
1 parent 1d37366 commit cda5c6c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ namespace nil::crypto3::multiprecision {
// Division

static constexpr big_int divide(const big_int& x, const big_int& y) {
return x.m_abs / y.m_abs;
big_int result = x.m_abs / y.m_abs;
if (x.negative() != y.negative()) {
result.negate();
}
return result;
}

// Multiplication
Expand Down

0 comments on commit cda5c6c

Please sign in to comment.