libstdc++
Rational Arithmetic
Collaboration diagram for Rational Arithmetic:

Classes

struct  std::ratio< _Num, _Den >
 
struct  std::ratio_add< _R1, _R2 >
 
struct  std::ratio_divide< _R1, _R2 >
 
struct  std::ratio_equal< _R1, _R2 >
 
struct  std::ratio_multiply< _R1, _R2 >
 
struct  std::ratio_not_equal< _R1, _R2 >
 
struct  std::ratio_subtract< _R1, _R2 >
 

Typedefs

typedef ratio< num, den > std::ratio< _Num, _Den >::type
 
typedef ratio< __n/__gcd2,
__safe_multiply< _R1::den/__gcd2,
_R2::den/__gcd >::value > 
std::ratio_add< _R1, _R2 >::type
 
typedef ratio_add< _R1, ratio
<-_R2::num, _R2::den > >::type 
std::ratio_subtract< _R1, _R2 >::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 intmax_t std::ratio< _Num, _Den >::den
 
static constexpr intmax_t std::ratio_add< _R1, _R2 >::den
 
static constexpr intmax_t std::ratio_subtract< _R1, _R2 >::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_add< _R1, _R2 >::num
 
static constexpr intmax_t std::ratio_subtract< _R1, _R2 >::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
 
static const intmax_t std::__safe_add< _Pn, _Qn >::value
 

Detailed Description

Compile time representation of finite rational numbers.