diff --git a/include/boost/integer/extended_euclidean.hpp b/include/boost/integer/extended_euclidean.hpp index f89a540..c3dc50d 100644 --- a/include/boost/integer/extended_euclidean.hpp +++ b/include/boost/integer/extended_euclidean.hpp @@ -68,7 +68,7 @@ euclidean_result_t extended_euclidean(Z m, Z n) if (swapped) { - return {u0, u2, u2}; + return {u0, u2, u1}; } return {u0, u1, u2}; } diff --git a/test/extended_euclidean_test.cpp b/test/extended_euclidean_test.cpp index d3fd59e..d114f7c 100644 --- a/test/extended_euclidean_test.cpp +++ b/test/extended_euclidean_test.cpp @@ -5,7 +5,6 @@ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include -#include #include #include #include @@ -18,7 +17,6 @@ using boost::integer::gcd; template void test_extended_euclidean() { - std::cout << "Testing the extended Euclidean algorithm on type " << boost::typeindex::type_id().pretty_name() << "\n"; // Stress test: //Z max_arg = std::numeric_limits::max(); Z max_arg = 500; diff --git a/test/mod_inverse_test.cpp b/test/mod_inverse_test.cpp index e482384..74d64e6 100644 --- a/test/mod_inverse_test.cpp +++ b/test/mod_inverse_test.cpp @@ -5,7 +5,6 @@ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include -#include #include #include #include @@ -18,7 +17,6 @@ using boost::integer::gcd; template void test_mod_inverse() { - std::cout << "Testing the modular multiplicative inverse on type " << boost::typeindex::type_id().pretty_name() << "\n"; //Z max_arg = std::numeric_limits::max(); Z max_arg = 500; for (Z modulus = 2; modulus < max_arg; ++modulus)