Rational Arithmetic
Utilities
Collaboration diagram for Rational Arithmetic:

## Classes

struct | std::ratio< _Num, _Den >
struct | std::ratio_equal< _R1, _R2 >
struct | std::ratio_not_equal< _R1, _R2 >

## Typedefs

template<typename _R1 , typename _R2 >
using | std::ratio_divide = typename __ratio_divide< _R1, _R2 >::type
template<typename _R1 , typename _R2 >
using | std::ratio_multiply = typename __ratio_multiply< _R1, _R2 >::type
typedef ratio< num, den > | std::ratio< _Num, _Den >::type
typedef ratio< __safe_multiply<(_R1::num/__gcd1),(_R2::num/__gcd2)>::value, __safe_multiply<(_R1::den/__gcd2),(_R2::den/__gcd1)>::value > | std::__ratio_multiply< _R1, _R2 >::type
typedef __ratio_multiply< _R1, ratio< _R2::den, _R2::num > >::type | std::__ratio_divide< _R1, _R2 >::type

## Variables

static constexpr uintmax_t | std::__big_add< __hi1, __lo1, __hi2, __lo2 >::__hi
static constexpr uintmax_t | std::__big_sub< __hi1, __lo1, __hi2, __lo2 >::__hi
static constexpr uintmax_t | std::__big_mul< __x, __y >::__hi
static constexpr uintmax_t | std::__big_add< __hi1, __lo1, __hi2, __lo2 >::__lo
static constexpr uintmax_t | std::__big_sub< __hi1, __lo1, __hi2, __lo2 >::__lo
static constexpr uintmax_t | std::__big_mul< __x, __y >::__lo
static constexpr uintmax_t | std::__big_div_impl< __n1, __n0, __d >::__quot
static constexpr uintmax_t | std::__big_div< __n1, __n0, __d >::__quot_hi
static constexpr uintmax_t | std::__big_div< __n1, __n0, __d >::__quot_lo
static constexpr uintmax_t | std::__big_div_impl< __n1, __n0, __d >::__rem
static constexpr uintmax_t | std::__big_div< __n1, __n0, __d >::__rem
static constexpr intmax_t | std::ratio< _Num, _Den >::den
static constexpr intmax_t | std::__ratio_multiply< _R1, _R2 >::den
static constexpr intmax_t | std::__ratio_divide< _R1, _R2 >::den
static constexpr intmax_t | std::ratio< _Num, _Den >::num
static constexpr intmax_t | std::__ratio_multiply< _R1, _R2 >::num
static constexpr intmax_t | std::__ratio_divide< _R1, _R2 >::num
static const intmax_t | std::__safe_multiply< _Pn, _Qn >::value

## Detailed Description

Compile time representation of finite rational numbers.

## Typedef Documentation

## ratio_divide

template<typename _R1 , typename _R2 >

using std::ratio_divide = typedef typename __ratio_divide<_R1, _R2>::type

ratio_divide

Definition at line 334 of file ratio.

## ratio_multiply

template<typename _R1 , typename _R2 >

using std::ratio_multiply = typedef typename __ratio_multiply<_R1, _R2>::type

ratio_multiply

Definition at line 311 of file ratio.

## type [1/3]

template<intmax_t _Num, intmax_t _Den = 1>

typedef ratio<num, den> std::ratio< _Num, _Den >::type

Definition at line 274 of file ratio.

## type [2/3]

template<typename _R1 , typename _R2 >

typedef ratio< __safe_multiply<(_R1::num / __gcd1), (_R2::num / __gcd2)>::value, __safe_multiply<(_R1::den / __gcd2), (_R2::den / __gcd1)>::value> std::__ratio_multiply< _R1, _R2 >::type

Definition at line 297 of file ratio.

## type [3/3]

template<typename _R1 , typename _R2 >

typedef __ratio_multiply<_R1,ratio<_R2::den,_R2::num>>::type std::__ratio_divide< _R1, _R2 >::type

Definition at line 320 of file ratio.

## Variable Documentation

## __hi [1/3]

template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>

constexpr uintmax_t std::__big_add< __hi1, __lo1, __hi2, __lo2 >::__hi

static constexpr

Definition at line 121 of file ratio.

## __hi [2/3]

template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>

constexpr uintmax_t std::__big_sub< __hi1, __lo1, __hi2, __lo2 >::__hi

static constexpr

Definition at line 132 of file ratio.

## __hi [3/3]

template<uintmax_t __x, uintmax_t __y>

constexpr uintmax_t std::__big_mul< __x, __y >::__hi

static constexpr

Definition at line 156 of file ratio.

## __lo [1/3]

template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>

constexpr uintmax_t std::__big_add< __hi1, __lo1, __hi2, __lo2 >::__lo

static constexpr

Definition at line 120 of file ratio.

## __lo [2/3]

template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>

constexpr uintmax_t std::__big_sub< __hi1, __lo1, __hi2, __lo2 >::__lo

static constexpr

Definition at line 131 of file ratio.

## __lo [3/3]

template<uintmax_t __x, uintmax_t __y>

constexpr uintmax_t std::__big_mul< __x, __y >::__lo

static constexpr

Definition at line 157 of file ratio.

## __quot

template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>

constexpr uintmax_t std::__big_div_impl< __n1, __n0, __d >::__quot

static constexpr

Definition at line 197 of file ratio.

## __quot_hi

template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>

constexpr uintmax_t std::__big_div< __n1, __n0, __d >::__quot_hi

static constexpr

Definition at line 229 of file ratio.

## __quot_lo

template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>

constexpr uintmax_t std::__big_div< __n1, __n0, __d >::__quot_lo

static constexpr

Definition at line 230 of file ratio.

## __rem [1/2]

template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>

constexpr uintmax_t std::__big_div_impl< __n1, __n0, __d >::__rem

static constexpr

Definition at line 198 of file ratio.

## __rem [2/2]

template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>

constexpr uintmax_t std::__big_div< __n1, __n0, __d >::__rem

static constexpr

Definition at line 231 of file ratio.

## den [1/3]

template<intmax_t _Num, intmax_t _Den>

constexpr intmax_t std::ratio< _Num, _Den >::den

static constexpr

Definition at line 271 of file ratio.

## den [2/3]

template<typename _R1 , typename _R2 >

constexpr intmax_t std::__ratio_multiply< _R1, _R2 >::den

static constexpr

Definition at line 300 of file ratio.

## den [3/3]

template<typename _R1 , typename _R2 >

constexpr intmax_t std::__ratio_divide< _R1, _R2 >::den

static constexpr

Definition at line 323 of file ratio.

## num [1/3]

template<intmax_t _Num, intmax_t _Den>

constexpr intmax_t std::ratio< _Num, _Den >::num

static constexpr

Definition at line 268 of file ratio.

## num [2/3]

template<typename _R1 , typename _R2 >

constexpr intmax_t std::__ratio_multiply< _R1, _R2 >::num

static constexpr

Definition at line 299 of file ratio.

## num [3/3]

template<typename _R1 , typename _R2 >

constexpr intmax_t std::__ratio_divide< _R1, _R2 >::num

static constexpr

Definition at line 322 of file ratio.

## value

template<intmax_t _Pn, intmax_t _Qn>

const intmax_t std::__safe_multiply< _Pn, _Qn >::value

static

Definition at line 106 of file ratio.