xo-ratio: rename reduce() -> normalize()

This commit is contained in:
Roland Conybeare 2024-04-19 07:17:36 -04:00
commit a0eda881a6
2 changed files with 4 additions and 4 deletions

View file

@ -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<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_);

View file

@ -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>