Ratio Functions
#include <xo/ratio/ratio.hpp>
-
template<typename Int1, typename Int2>
ratio<std::common_type_t<Int1, Int2>> xo::ratio::make_ratio(Int1 n, Int2 d = 1) create a ratio in lowest terms from two integers
- group Ratio-arithmetic
Functions
-
template<typename Ratio1, typename Ratio2>
inline 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 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 3way comparison