libstdc++
Rational Arithmetic
Collaboration diagram for Rational Arithmetic:

Classes

struct  std::ratio< _Num, _Den >
 Provides compile-time rational arithmetic. More...
struct  std::ratio_divide< _R1, _R2 >
 ratio_divide More...
struct  std::ratio_equal< _R1, _R2 >
 ratio_equal More...
struct  std::ratio_multiply< _R1, _R2 >
 ratio_multiply More...
struct  std::ratio_not_equal< _R1, _R2 >
 ratio_not_equal More...

Typedefs

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

Functions

 std::__big_sub< __hi1, __lo1, __hi2, __lo2 >::static_assert (!__big_less< __hi1, __lo1, __hi2, __lo2 >::value,"Internal library error")
 std::ratio< _Num, _Den >::static_assert (_Den!=0,"denominator cannot be zero")
 std::ratio< _Num, _Den >::static_assert (_Num >=-__INTMAX_MAX__ &&_Den >=-__INTMAX_MAX__,"out of range")
 std::ratio_divide< _R1, _R2 >::static_assert (_R2::num!=0,"division by 0")

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.