DOKK / manpages / debian 12 / libstdc++-11-doc / std::ratio.3cxx.en
std::ratio< _Num, _Den >(3cxx) std::ratio< _Num, _Den >(3cxx)

std::ratio< _Num, _Den > - Provides compile-time rational arithmetic.


typedef ratio< num, den > type


static constexpr intmax_t den
static constexpr intmax_t num

struct std::ratio< _Num, _Den >"Provides compile-time rational arithmetic.

This class template represents any finite rational number with a numerator and denominator representable by compile-time constants of type intmax_t. The ratio is simplified when instantiated.

For example:

std::ratio<7,-21>::num == -1;
std::ratio<7,-21>::den == 3;

Definition at line 266 of file ratio.

Definition at line 279 of file ratio.

Generated automatically by Doxygen for libstdc++ from the source code.

Thu Feb 16 2023 libstdc++