logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

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

                                                    libstdc++                     std::ratio<_Num,_Den>(3cxx)

Detailed Description

template<intmax_t_Num,intmax_t_Den=1>
       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;

Name

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

Synopsis

       #include <ratio>

   PublicTypestypedefratio< num, den > typeStaticPublicAttributesstatic constexpr intmax_tdenstatic constexpr intmax_tnum

See Also