From 2dbf50bb79df53fdd42baef95bf924bfe32ef7a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:38:51 +0000 Subject: [PATCH 01/10] Add Euclidean division APIs and tests Agent-Logs-Url: https://github.com/eisenwave/integer-division/sessions/c85ad039-95b9-4128-9b7d-5e78ee454c16 Co-authored-by: eisenwave <22040976+eisenwave@users.noreply.github.com> --- intdiv.hpp | 20 ++++++++++++ test.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/intdiv.hpp b/intdiv.hpp index 0fd304b..32d1231 100644 --- a/intdiv.hpp +++ b/intdiv.hpp @@ -105,6 +105,26 @@ constexpr T div_to_neg_inf(T x, T y) { return div_rem_to_neg_inf(x, y).quotient; } +template<__integer T> +constexpr div_result div_rem_euclid(T x, T y) { + if constexpr (std::is_signed_v) { + bool adjust = x % y < 0; + return __div_rem_offset_quotient(x, y, T(adjust) * -__sgn2(y)); + } else { + return div_rem_to_zero(x, y); + } +} + +template<__integer T> +constexpr T div_euclid(T x, T y) { + return div_rem_euclid(x, y).quotient; +} + +template<__integer T> +constexpr T mod_euclid(T x, T y) { + return div_rem_euclid(x, y).remainder; +} + template<__integer T> constexpr div_result div_rem_to_odd(T x, T y) { T quotient_sign = __sgn2(x) * __sgn2(y); diff --git a/test.cpp b/test.cpp index 84516a0..ab041b4 100644 --- a/test.cpp +++ b/test.cpp @@ -77,6 +77,16 @@ constexpr bool is_valid_division_to_neg_inf(T x, T y, T q, T r) { } } +template +constexpr bool is_valid_division_euclid(T x, T y, T q, T r) { + if (!is_valid_division(x, y, q, r)) return false; + if constexpr (std::is_signed_v) { + return r >= 0 && std::abs(big_int(r)) < std::abs(big_int(y)); + } else { + return r < y; + } +} + template constexpr bool is_valid_division_to_odd(T x, T y, T q, T r) { if (!is_valid_division(x, y, q, r)) return false; @@ -115,6 +125,11 @@ static_assert(div_rem_away_zero(72'777'531u, 3'405'476'348u).quotient == 1); static_assert(72'777'531u == 1u * 3'405'476'348u + 962'268'479u); static_assert(div_rem_away_zero(72'777'531u, 3'405'476'348u).remainder == 962'268'479u); static_assert(div_rem_to_pos_inf(72'777'531u, 3'405'476'348u).remainder == 962'268'479u); +static_assert(div_rem_euclid(-8, 3) == div_result{-3, 1}); +static_assert(div_rem_euclid(-8, -3) == div_result{3, 1}); +static_assert(div_rem_euclid(8, -3) == div_result{-2, 2}); +static_assert(div_euclid(-8, 3) == -3); +static_assert(mod_euclid(8, -3) == 2); template constexpr bool is_valid_division_ties_to_zero(T x, T y, T q, T r) { @@ -272,6 +287,76 @@ void fuzz_test_mod(std::string_view name) { std::cout << "OK" << std::endl; } +template +void fuzz_test_euclid_projection(std::string_view name) { + std::cout << name << " ... " << std::flush; + auto verify = [](T x, T y) { + const auto result = div_rem_euclid(x, y); + return div_euclid(x, y) == result.quotient && mod_euclid(x, y) == result.remainder; + }; + + for (const T& x : interesting_values) { + for (const T& y : interesting_values) { + if (!is_div_defined(x, y)) continue; + if (!verify(x, y)) { + std::cout << "failed for (" << x << " / " << y << ")\n"; + std::exit(1); + } + } + } + + std::default_random_engine rng{12345}; + + std::uniform_int_distribution distr_tiny{std::is_signed_v ? -4 : 0, 4}; + for (int i = 0; i < 100; ++i) { + const T x = distr_tiny(rng); + const T y = distr_tiny(rng); + if (!is_div_defined(x, y)) continue; + if (!verify(x, y)) { + std::cout << "failed for (" << x << " / " << y << ")\n"; + std::exit(1); + } + } + + std::uniform_int_distribution distr_full; + for (int i = 0; i < full_samples; ++i) { + const T x = distr_full(rng); + const T y = distr_full(rng); + if (!is_div_defined(x, y)) continue; + if (!verify(x, y)) { + std::cout << "failed for (" << x << " / " << y << ")\n"; + std::exit(1); + } + } + + std::cout << "OK" << std::endl; +} + +template +void fuzz_test_mod_euclid(std::string_view name) { + std::cout << name << " ... "; + std::default_random_engine rng{12345}; + std::uniform_int_distribution distr_full; + + for (int i = 0; i < full_samples; ++i) { + T x = distr_full(rng); + T y = distr_full(rng); + if (!is_div_defined(x, y)) continue; + T r = mod_euclid(x, y); + if (r != div_rem_euclid(x, y).remainder) { + std::cout << "failure for (" << x << " mod_euclid " << y << ") = " << r << '\n'; + std::exit(1); + } + if constexpr (std::is_signed_v) { + if (r < 0 || std::abs(big_int(r)) >= std::abs(big_int(y))) { + std::cout << "failure for (" << x << " mod_euclid " << y << ") = " << r << '\n'; + std::exit(1); + } + } + } + std::cout << "OK" << std::endl; +} + #define RUN_TEST(type, div_rem, verify) fuzz_test(#div_rem "<" #type ">") int main() { @@ -279,6 +364,7 @@ int main() { RUN_TEST(int, div_rem_away_zero, is_valid_division_away_zero); RUN_TEST(int, div_rem_to_pos_inf, is_valid_division_to_pos_inf); RUN_TEST(int, div_rem_to_neg_inf, is_valid_division_to_neg_inf); + RUN_TEST(int, div_rem_euclid, is_valid_division_euclid); RUN_TEST(int, div_rem_to_odd, is_valid_division_to_odd); RUN_TEST(int, div_rem_to_even, is_valid_division_to_even); @@ -293,6 +379,7 @@ int main() { RUN_TEST(unsigned, div_rem_away_zero, is_valid_division_away_zero); RUN_TEST(unsigned, div_rem_to_pos_inf, is_valid_division_to_pos_inf); RUN_TEST(unsigned, div_rem_to_neg_inf, is_valid_division_to_neg_inf); + RUN_TEST(unsigned, div_rem_euclid, is_valid_division_euclid); RUN_TEST(unsigned, div_rem_to_odd, is_valid_division_to_odd); RUN_TEST(unsigned, div_rem_to_even, is_valid_division_to_even); @@ -305,4 +392,8 @@ int main() { fuzz_test_mod("mod"); fuzz_test_mod("mod"); + fuzz_test_euclid_projection("euclid projections"); + fuzz_test_euclid_projection("euclid projections"); + fuzz_test_mod_euclid("mod_euclid"); + fuzz_test_mod_euclid("mod_euclid"); } From d37ff35e413e114c0e3132f32ccc8f93c95e636f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:40:47 +0000 Subject: [PATCH 02/10] Align Euclidean remainder API with paper Agent-Logs-Url: https://github.com/eisenwave/integer-division/sessions/c85ad039-95b9-4128-9b7d-5e78ee454c16 Co-authored-by: eisenwave <22040976+eisenwave@users.noreply.github.com> --- intdiv.hpp | 2 +- test.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/intdiv.hpp b/intdiv.hpp index 32d1231..99d68f8 100644 --- a/intdiv.hpp +++ b/intdiv.hpp @@ -121,7 +121,7 @@ constexpr T div_euclid(T x, T y) { } template<__integer T> -constexpr T mod_euclid(T x, T y) { +constexpr T rem_euclid(T x, T y) { return div_rem_euclid(x, y).remainder; } diff --git a/test.cpp b/test.cpp index ab041b4..99d12b6 100644 --- a/test.cpp +++ b/test.cpp @@ -129,7 +129,7 @@ static_assert(div_rem_euclid(-8, 3) == div_result{-3, 1}); static_assert(div_rem_euclid(-8, -3) == div_result{3, 1}); static_assert(div_rem_euclid(8, -3) == div_result{-2, 2}); static_assert(div_euclid(-8, 3) == -3); -static_assert(mod_euclid(8, -3) == 2); +static_assert(rem_euclid(8, -3) == 2); template constexpr bool is_valid_division_ties_to_zero(T x, T y, T q, T r) { @@ -292,7 +292,7 @@ void fuzz_test_euclid_projection(std::string_view name) { std::cout << name << " ... " << std::flush; auto verify = [](T x, T y) { const auto result = div_rem_euclid(x, y); - return div_euclid(x, y) == result.quotient && mod_euclid(x, y) == result.remainder; + return div_euclid(x, y) == result.quotient && rem_euclid(x, y) == result.remainder; }; for (const T& x : interesting_values) { @@ -333,7 +333,7 @@ void fuzz_test_euclid_projection(std::string_view name) { } template -void fuzz_test_mod_euclid(std::string_view name) { +void fuzz_test_rem_euclid(std::string_view name) { std::cout << name << " ... "; std::default_random_engine rng{12345}; std::uniform_int_distribution distr_full; @@ -342,14 +342,14 @@ void fuzz_test_mod_euclid(std::string_view name) { T x = distr_full(rng); T y = distr_full(rng); if (!is_div_defined(x, y)) continue; - T r = mod_euclid(x, y); + T r = rem_euclid(x, y); if (r != div_rem_euclid(x, y).remainder) { - std::cout << "failure for (" << x << " mod_euclid " << y << ") = " << r << '\n'; + std::cout << "failure for (" << x << " rem_euclid " << y << ") = " << r << '\n'; std::exit(1); } if constexpr (std::is_signed_v) { if (r < 0 || std::abs(big_int(r)) >= std::abs(big_int(y))) { - std::cout << "failure for (" << x << " mod_euclid " << y << ") = " << r << '\n'; + std::cout << "failure for (" << x << " rem_euclid " << y << ") = " << r << '\n'; std::exit(1); } } @@ -394,6 +394,6 @@ int main() { fuzz_test_mod("mod"); fuzz_test_euclid_projection("euclid projections"); fuzz_test_euclid_projection("euclid projections"); - fuzz_test_mod_euclid("mod_euclid"); - fuzz_test_mod_euclid("mod_euclid"); + fuzz_test_rem_euclid("rem_euclid"); + fuzz_test_rem_euclid("rem_euclid"); } From 8660e5bb8ae9fad7564847738939f3debeba3bca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:42:42 +0000 Subject: [PATCH 03/10] Fix Euclidean test type warnings Agent-Logs-Url: https://github.com/eisenwave/integer-division/sessions/c85ad039-95b9-4128-9b7d-5e78ee454c16 Co-authored-by: eisenwave <22040976+eisenwave@users.noreply.github.com> --- test.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test.cpp b/test.cpp index 99d12b6..35a0c4b 100644 --- a/test.cpp +++ b/test.cpp @@ -257,10 +257,18 @@ void fuzz_test(std::string_view name) { std::default_random_engine rng{12345}; - std::uniform_int_distribution distr_tiny{std::is_signed_v ? -4 : 0, 4}; + constexpr T tiny_min = [] { + if constexpr (std::is_signed_v) return T(-4); + else return T(0); + }(); + std::uniform_int_distribution distr_tiny{tiny_min, T(4)}; sample(rng, distr_tiny, 100); - std::uniform_int_distribution distr_small{std::is_signed_v ? -100 : 0, 100}; + constexpr T small_min = [] { + if constexpr (std::is_signed_v) return T(-100); + else return T(0); + }(); + std::uniform_int_distribution distr_small{small_min, T(100)}; sample(rng, distr_small, 100'000); std::uniform_int_distribution distr_full; @@ -307,7 +315,11 @@ void fuzz_test_euclid_projection(std::string_view name) { std::default_random_engine rng{12345}; - std::uniform_int_distribution distr_tiny{std::is_signed_v ? -4 : 0, 4}; + constexpr T tiny_min = [] { + if constexpr (std::is_signed_v) return T(-4); + else return T(0); + }(); + std::uniform_int_distribution distr_tiny{tiny_min, T(4)}; for (int i = 0; i < 100; ++i) { const T x = distr_tiny(rng); const T y = distr_tiny(rng); From 00f6f09befa0a2870a0b742a393407751080d1a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:44:17 +0000 Subject: [PATCH 04/10] Apply final Euclidean review cleanups Agent-Logs-Url: https://github.com/eisenwave/integer-division/sessions/c85ad039-95b9-4128-9b7d-5e78ee454c16 Co-authored-by: eisenwave <22040976+eisenwave@users.noreply.github.com> --- intdiv.hpp | 2 +- test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intdiv.hpp b/intdiv.hpp index 99d68f8..26f188b 100644 --- a/intdiv.hpp +++ b/intdiv.hpp @@ -108,7 +108,7 @@ constexpr T div_to_neg_inf(T x, T y) { template<__integer T> constexpr div_result div_rem_euclid(T x, T y) { if constexpr (std::is_signed_v) { - bool adjust = x % y < 0; + bool adjust = div_rem_to_zero(x, y).remainder < 0; return __div_rem_offset_quotient(x, y, T(adjust) * -__sgn2(y)); } else { return div_rem_to_zero(x, y); diff --git a/test.cpp b/test.cpp index 35a0c4b..c6a58c1 100644 --- a/test.cpp +++ b/test.cpp @@ -346,7 +346,7 @@ void fuzz_test_euclid_projection(std::string_view name) { template void fuzz_test_rem_euclid(std::string_view name) { - std::cout << name << " ... "; + std::cout << name << " ... " << std::flush; std::default_random_engine rng{12345}; std::uniform_int_distribution distr_full; From 15c66f6b9616b07a0e3d53fe8f0e49d049c0fa3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:47:35 +0000 Subject: [PATCH 05/10] Deduplicate Euclidean test helpers Agent-Logs-Url: https://github.com/eisenwave/integer-division/sessions/c85ad039-95b9-4128-9b7d-5e78ee454c16 Co-authored-by: eisenwave <22040976+eisenwave@users.noreply.github.com> --- test.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test.cpp b/test.cpp index c6a58c1..f1c8734 100644 --- a/test.cpp +++ b/test.cpp @@ -78,8 +78,7 @@ constexpr bool is_valid_division_to_neg_inf(T x, T y, T q, T r) { } template -constexpr bool is_valid_division_euclid(T x, T y, T q, T r) { - if (!is_valid_division(x, y, q, r)) return false; +constexpr bool is_valid_euclid_remainder(T y, T r) { if constexpr (std::is_signed_v) { return r >= 0 && std::abs(big_int(r)) < std::abs(big_int(y)); } else { @@ -87,6 +86,12 @@ constexpr bool is_valid_division_euclid(T x, T y, T q, T r) { } } +template +constexpr bool is_valid_division_euclid(T x, T y, T q, T r) { + if (!is_valid_division(x, y, q, r)) return false; + return is_valid_euclid_remainder(y, r); +} + template constexpr bool is_valid_division_to_odd(T x, T y, T q, T r) { if (!is_valid_division(x, y, q, r)) return false; @@ -181,6 +186,12 @@ constexpr bool is_valid_division_ties_to_even(T x, T y, T q, T r) { using rng_type = std::default_random_engine; +template +constexpr T signed_or_zero() { + if constexpr (std::is_signed_v) return T(SignedValue); + else return T(0); +} + template inline auto interesting_values = [] { if constexpr (std::is_signed_v) { @@ -257,17 +268,11 @@ void fuzz_test(std::string_view name) { std::default_random_engine rng{12345}; - constexpr T tiny_min = [] { - if constexpr (std::is_signed_v) return T(-4); - else return T(0); - }(); + constexpr T tiny_min = signed_or_zero(); std::uniform_int_distribution distr_tiny{tiny_min, T(4)}; sample(rng, distr_tiny, 100); - constexpr T small_min = [] { - if constexpr (std::is_signed_v) return T(-100); - else return T(0); - }(); + constexpr T small_min = signed_or_zero(); std::uniform_int_distribution distr_small{small_min, T(100)}; sample(rng, distr_small, 100'000); @@ -315,10 +320,7 @@ void fuzz_test_euclid_projection(std::string_view name) { std::default_random_engine rng{12345}; - constexpr T tiny_min = [] { - if constexpr (std::is_signed_v) return T(-4); - else return T(0); - }(); + constexpr T tiny_min = signed_or_zero(); std::uniform_int_distribution distr_tiny{tiny_min, T(4)}; for (int i = 0; i < 100; ++i) { const T x = distr_tiny(rng); @@ -359,11 +361,9 @@ void fuzz_test_rem_euclid(std::string_view name) { std::cout << "failure for (" << x << " rem_euclid " << y << ") = " << r << '\n'; std::exit(1); } - if constexpr (std::is_signed_v) { - if (r < 0 || std::abs(big_int(r)) >= std::abs(big_int(y))) { - std::cout << "failure for (" << x << " rem_euclid " << y << ") = " << r << '\n'; - std::exit(1); - } + if (!is_valid_euclid_remainder(y, r)) { + std::cout << "failure for (" << x << " rem_euclid " << y << ") = " << r << '\n'; + std::exit(1); } } std::cout << "OK" << std::endl; From a7d6b48af12b52a32ccf4af7541359a6c05c6e11 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:49:35 +0000 Subject: [PATCH 06/10] Implement rem_euclid directly Agent-Logs-Url: https://github.com/eisenwave/integer-division/sessions/c85ad039-95b9-4128-9b7d-5e78ee454c16 Co-authored-by: eisenwave <22040976+eisenwave@users.noreply.github.com> --- intdiv.hpp | 21 ++++++++++++++++++--- test.cpp | 3 ++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/intdiv.hpp b/intdiv.hpp index 26f188b..51c234a 100644 --- a/intdiv.hpp +++ b/intdiv.hpp @@ -105,11 +105,26 @@ constexpr T div_to_neg_inf(T x, T y) { return div_rem_to_neg_inf(x, y).quotient; } +template<__integer T> +constexpr T __rem_euclid_from_rem(T rem, T y) { + if constexpr (std::is_signed_v) { + using U = std::make_unsigned_t; + return T(U(rem) + U(rem < 0) * U(__sgn2(y)) * U(y)); + } else { + return rem; + } +} + template<__integer T> constexpr div_result div_rem_euclid(T x, T y) { if constexpr (std::is_signed_v) { - bool adjust = div_rem_to_zero(x, y).remainder < 0; - return __div_rem_offset_quotient(x, y, T(adjust) * -__sgn2(y)); + T quotient = T(x / y); + T remainder = T(x % y); + bool adjust = remainder < 0; + return { + .quotient = T(quotient - T(adjust) * __sgn2(y)), + .remainder = __rem_euclid_from_rem(remainder, y), + }; } else { return div_rem_to_zero(x, y); } @@ -122,7 +137,7 @@ constexpr T div_euclid(T x, T y) { template<__integer T> constexpr T rem_euclid(T x, T y) { - return div_rem_euclid(x, y).remainder; + return __rem_euclid_from_rem(T(x % y), y); } template<__integer T> diff --git a/test.cpp b/test.cpp index f1c8734..1322dcf 100644 --- a/test.cpp +++ b/test.cpp @@ -356,8 +356,9 @@ void fuzz_test_rem_euclid(std::string_view name) { T x = distr_full(rng); T y = distr_full(rng); if (!is_div_defined(x, y)) continue; + const auto result = div_rem_euclid(x, y); T r = rem_euclid(x, y); - if (r != div_rem_euclid(x, y).remainder) { + if (r != result.remainder) { std::cout << "failure for (" << x << " rem_euclid " << y << ") = " << r << '\n'; std::exit(1); } From c1a43ef6b34f3e8e2fb281cda27418263aba7747 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 13 May 2026 22:14:41 +0200 Subject: [PATCH 07/10] Rewrite to be more in line with paper --- intdiv.hpp | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/intdiv.hpp b/intdiv.hpp index 51c234a..8a9d968 100644 --- a/intdiv.hpp +++ b/intdiv.hpp @@ -2,8 +2,8 @@ #define INTDIV_HPP #include -#include #include +#include using __suppress_unused_include_compare_warning = std::strong_ordering; @@ -105,29 +105,11 @@ constexpr T div_to_neg_inf(T x, T y) { return div_rem_to_neg_inf(x, y).quotient; } -template<__integer T> -constexpr T __rem_euclid_from_rem(T rem, T y) { - if constexpr (std::is_signed_v) { - using U = std::make_unsigned_t; - return T(U(rem) + U(rem < 0) * U(__sgn2(y)) * U(y)); - } else { - return rem; - } -} - template<__integer T> constexpr div_result div_rem_euclid(T x, T y) { - if constexpr (std::is_signed_v) { - T quotient = T(x / y); - T remainder = T(x % y); - bool adjust = remainder < 0; - return { - .quotient = T(quotient - T(adjust) * __sgn2(y)), - .remainder = __rem_euclid_from_rem(remainder, y), - }; - } else { - return div_rem_to_zero(x, y); - } + T quotient_sign = __sgn2(x) * __sgn2(y); + bool increment = x % y < 0; + return __div_rem_offset_quotient(x, y, T(increment) * quotient_sign); } template<__integer T> @@ -137,7 +119,12 @@ constexpr T div_euclid(T x, T y) { template<__integer T> constexpr T rem_euclid(T x, T y) { - return __rem_euclid_from_rem(T(x % y), y); + if constexpr (std::is_signed_v) { + using U = std::make_unsigned_t; + return T(U(x % y) + U(x % y < 0) * U(__sgn2(y)) * U(y)); + } else { + return x % y; + } } template<__integer T> From 0e4f2067ea5c2118613ffb96cb065f34abac1685 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 13 May 2026 22:18:25 +0200 Subject: [PATCH 08/10] Test clang-format --- test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.cpp b/test.cpp index 1322dcf..2508ce0 100644 --- a/test.cpp +++ b/test.cpp @@ -403,7 +403,7 @@ int main() { RUN_TEST(unsigned, div_rem_ties_to_odd, is_valid_division_ties_to_odd); RUN_TEST(unsigned, div_rem_ties_to_even, is_valid_division_ties_to_even); - fuzz_test_mod("mod"); +fuzz_test_mod("mod"); fuzz_test_mod("mod"); fuzz_test_euclid_projection("euclid projections"); fuzz_test_euclid_projection("euclid projections"); From cd232c40b9372b4222c11be5aea0087dbd99afb8 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Wed, 13 May 2026 22:19:24 +0200 Subject: [PATCH 09/10] Update test.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.cpp b/test.cpp index 2508ce0..1322dcf 100644 --- a/test.cpp +++ b/test.cpp @@ -403,7 +403,7 @@ int main() { RUN_TEST(unsigned, div_rem_ties_to_odd, is_valid_division_ties_to_odd); RUN_TEST(unsigned, div_rem_ties_to_even, is_valid_division_ties_to_even); -fuzz_test_mod("mod"); + fuzz_test_mod("mod"); fuzz_test_mod("mod"); fuzz_test_euclid_projection("euclid projections"); fuzz_test_euclid_projection("euclid projections"); From 8f88e85f0116bd40abdb845f104639e39081fca7 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 13 May 2026 22:22:02 +0200 Subject: [PATCH 10/10] format --- test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test.cpp b/test.cpp index 1322dcf..077628b 100644 --- a/test.cpp +++ b/test.cpp @@ -188,8 +188,10 @@ using rng_type = std::default_random_engine; template constexpr T signed_or_zero() { - if constexpr (std::is_signed_v) return T(SignedValue); - else return T(0); + if constexpr (std::is_signed_v) + return T(SignedValue); + else + return T(0); } template