Skip to content

Commit

Permalink
xo-ratio: rename reduce() -> normalize()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rconybea committed Apr 19, 2024
1 parent 3b7a314 commit a0eda88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/xo/ratio/ratio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 **/
Expand Down Expand Up @@ -166,9 +166,9 @@ namespace xo {
*
* @pre @c Int type must be totally ordered
**/
constexpr ratio reduce() const requires std::totally_ordered<Int> {
constexpr ratio normalize() const requires std::totally_ordered<Int> {
if (den_ < 0)
return ratio(-num_, -den_).reduce();
return ratio(-num_, -den_).normalize();

auto factor = std::gcd(num_, den_);

Expand Down
2 changes: 1 addition & 1 deletion utest/ratio.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename Rng>
Expand Down

0 comments on commit a0eda88

Please sign in to comment.