std::ratio

std::ratio

Defined in header <ratio>
template< 
    std::intmax_t Num, 
    std::intmax_t Denom = 1 
> class ratio;
(since C++11)

The class template std::ratio provides compile-time rational arithmetic support. Each instantiation of this template exactly represents any finite rational number as long as its numerator Num and denominator Denom are representable as compile-time constants of type std::intmax_t. In addition, Denom may