std::ratio(3cxx)

std::ratio3cxx

Provides compile-time rational arithmetic.

Usage

#include <ratio>

Public Types

typedef ratio< num, den > type

Static Public Attributes

static constexpr intmax_t den
static constexpr intmax_t num

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;

Releases

7 releases since Debian 6.0 (Squeeze); the text changed 6 times.

  1. 6.0
  2. 7
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Author

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

From libstdc++-12-doc 12.4.0-5 in Debian 13 (Trixie). Also shipped by libstdc++-13-doc, libstdc++-14-doc. Parsed by carta from the page's man source.