libstdc++
Rational Arithmetic
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< __safe_multiply
<(_R1::num/__gcd1),(_R2::num/__gcd2)>
::value, __safe_multiply
<(_R1::den/__gcd2),(_R2::den/__gcd1)>
::value > 
std::__ratio_multiply< _R1, _R2 >::type
 

Variables

static constexpr uintmax_t std::__big_add< __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_mul< __x, __y >::__lo
 
static constexpr intmax_t std::__ratio_multiply< _R1, _R2 >::den
 
static constexpr intmax_t std::__ratio_multiply< _R1, _R2 >::num
 

Detailed Description

Compile time representation of finite rational numbers.

Typedef Documentation

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

ratio_divide

Definition at line 336 of file ratio.

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

ratio_multiply

Definition at line 313 of file ratio.