STD::RATIO(3cxx)
π NAME πΈ
Okay bestie, this page is for std::ratio< _Num, _Den > β and the manual name is literally std::ratio< _Num, _Den >(3cxx), from libstdc++. It's giving "Provides compile-time rational arithmetic." Periodt. π
β¨ SYNOPSIS β¨
#include <ratio>
π Public Types π
typedef ratio< num, den > typeβ the public type typedef, exactly as written. Slay. π
π§ Static Public Attributes π§
static constexpr intmax_t denβ the denominator, astatic constexpr intmax_t. Iconic.static constexpr intmax_t numβ the numerator, also astatic constexpr intmax_t. No cap.
π Detailed Description π
template<intmax_t _Num, intmax_t _Den = 1>
struct std::ratio< _Num, _Den >
This class template is literally "Provides compile-time rational arithmetic." (yes, with the quote marks, it's that kind of vibe).
It 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. Obsessed, honestly.
For example:
std::ratio<7,-21>::num == -1;
std::ratio<7,-21>::den == 3;
Those example lines are exact, bestie β the simplification is doing its main character thing. π¦
π«Ά Author π«Ά
Generated automatically by Doxygen for libstdc++ from the source code. So not a human author, just Doxygen doing its little automated dance. π
That's the whole page, bestie. Footer sign-off: libstdc++ for std::ratio< _Num, _Den >(3cxx) π
β¨ β and the original footer doesn't show a separate date, so no invented date from me, fr fr. π
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms