Ratio Functions
#include <xo/ratio/ratio.hpp>
-
template<typename Int1, typename Int2>
constexpr auto xo::ratio::make_ratio(Int1 n, Int2 d = 1) -> ratio<std::common_type_t<Int1, Int2>> create a ratio in lowest terms from two integers
- group ratio-arithmetic
Functions
-
template<typename Ratio1, typename Ratio2>
inline constexpr auto operator+(const Ratio1 &x, const Ratio2 &y) add two ratios.
One argument may be a non-ratio type if it can be promoted to a ratio
-
template<typename Ratio1, typename Ratio2>
inline constexpr auto operator-(const Ratio1 &x, const Ratio2 &y) subtract two ratios.
One argument may be a non-ratio type if it can be promoted to a ratio
-
template<typename Ratio1, typename Ratio2>
- group ratio-3way-compare