diff --git a/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/big_int.hpp b/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/big_int.hpp index 62ca839b35..0f631598c8 100644 --- a/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/big_int.hpp +++ b/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/big_int.hpp @@ -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