Type | Value of X | Value of Y | |
ratio_add<R1, R2> | R1::num * R2::den + | R1::den * R2::den | |
R2::num * R1::den | |||
ratio_subtract<R1, R2> | R1::num * R2::den - | R1::den * R2::den | |
R2::num * R1::den | |||
ratio_multiply<R1, R2> | R1::num * R2::num | R1::den * R2::den | |
ratio_divide<R1, R2> | R1::num * R2::den | R1::den * R2::num |
template<class R1, class R2>
struct ratio_equal : bool_constant<R1::num == R2::num && R1::den == R2::den> { };
template<class R1, class R2>
struct ratio_not_equal : bool_constant<!ratio_equal_v<R1, R2>> { };
template<class R1, class R2>
struct ratio_less : bool_constant<see below> { };
template<class R1, class R2>
struct ratio_less_equal : bool_constant<!ratio_less_v<R2, R1>> { };
template<class R1, class R2>
struct ratio_greater : bool_constant<ratio_less_v<R2, R1>> { };
template<class R1, class R2>
struct ratio_greater_equal : bool_constant<!ratio_less_v<R1, R2>> { };