From a0eda881a663d1f481415342eb429a1093027a28 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 19 Apr 2024 07:17:36 -0400 Subject: [PATCH] xo-ratio: rename reduce() -> normalize() --- include/xo/ratio/ratio.hpp | 6 +++--- utest/ratio.test.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/xo/ratio/ratio.hpp b/include/xo/ratio/ratio.hpp index a8f09e5..79270c1 100644 --- a/include/xo/ratio/ratio.hpp +++ b/include/xo/ratio/ratio.hpp @@ -41,7 +41,7 @@ namespace xo { * **/ static constexpr ratio reduce(Int n, Int d) { - return ratio(n, d).reduce(); + return ratio(n, d).normalize(); } /** @brief add two ratios **/ @@ -166,9 +166,9 @@ namespace xo { * * @pre @c Int type must be totally ordered **/ - constexpr ratio reduce() const requires std::totally_ordered { + constexpr ratio normalize() const requires std::totally_ordered { if (den_ < 0) - return ratio(-num_, -den_).reduce(); + return ratio(-num_, -den_).normalize(); auto factor = std::gcd(num_, den_); diff --git a/utest/ratio.test.cpp b/utest/ratio.test.cpp index 918f9b5..27d55f6 100644 --- a/utest/ratio.test.cpp +++ b/utest/ratio.test.cpp @@ -32,7 +32,7 @@ namespace xo { Int den_sign = sign_dist_(rng) ? -1 : +1; Int den = den_sign * (1 + int_dist_(rng)); - return xo::ratio::ratio(num, den).reduce(); + return xo::ratio::ratio(num, den).normalize(); } template