Fix bug in conversion.

This commit is contained in:
Marcel Keller
2024-03-27 11:48:57 +11:00
parent 7d59c3b586
commit bd1a3cbf13

View File

@@ -350,7 +350,7 @@ void to_signed_bigint(bigint& ans, const T& x)
{
ans = x;
// get sign and abs(x)
if (ans > T::get_ZpD().pr_half)
if (ans >= T::get_ZpD().pr_half)
ans -= T::pr();
}