xo-ratio: rename reduce() -> normalize()
This commit is contained in:
parent
3b7a3149a5
commit
a0eda881a6
2 changed files with 4 additions and 4 deletions
|
|
@ -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_);
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue