libstdc++
Rational Arithmetic
Collaboration diagram for Rational Arithmetic:

Files

file  ratio
 

Classes

struct  std::ratio< _Num, _Den >
 
struct  std::ratio_equal< _R1, _R2 >
 
struct  std::ratio_greater< _R1, _R2 >
 
struct  std::ratio_greater_equal< _R1, _R2 >
 
struct  std::ratio_less< _R1, _R2 >
 
struct  std::ratio_less_equal< _R1, _R2 >
 
struct  std::ratio_not_equal< _R1, _R2 >
 

Typedefs

typedef ratio< 1, 1000000000000000000 > std::atto
 
typedef ratio< 1, 100 > std::centi
 
typedef ratio< 10, 1 > std::deca
 
typedef ratio< 1, 10 > std::deci
 
typedef ratio< 1000000000000000000, 1 > std::exa
 
typedef ratio< 1, 1000000000000000 > std::femto
 
typedef ratio< 1000000000, 1 > std::giga
 
typedef ratio< 100, 1 > std::hecto
 
typedef ratio< 1000, 1 > std::kilo
 
typedef ratio< 1000000, 1 > std::mega
 
typedef ratio< 1, 1000000 > std::micro
 
typedef ratio< 1, 1000 > std::milli
 
typedef ratio< 1, 1000000000 > std::nano
 
typedef ratio< 1000000000000000, 1 > std::peta
 
typedef ratio< 1, 1000000000000 > std::pico
 
template<typename _R1 , typename _R2 >
using std::ratio_add = typename __ratio_add< _R1, _R2 >::type
 
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
 
template<typename _R1 , typename _R2 >
using std::ratio_subtract = typename __ratio_subtract< _R1, _R2 >::type
 
typedef ratio< 1000000000000, 1 > std::tera
 

Variables

static constexpr intmax_t std::ratio< _Num, _Den >::den
 
static constexpr intmax_t std::ratio< _Num, _Den >::num
 
template<typename _R1 , typename _R2 >
constexpr bool std::ratio_equal_v
 
template<typename _R1 , typename _R2 >
constexpr bool std::ratio_greater_equal_v
 
template<typename _R1 , typename _R2 >
constexpr bool std::ratio_greater_v
 
template<typename _R1 , typename _R2 >
constexpr bool std::ratio_less_equal_v
 
template<typename _R1 , typename _R2 >
constexpr bool std::ratio_less_v
 
template<typename _R1 , typename _R2 >
constexpr bool std::ratio_not_equal_v
 

Detailed Description

Compile time representation of finite rational numbers.

Typedef Documentation

◆ atto

typedef ratio<1, 1000000000000000000> std::atto

Definition at line 553 of file ratio.

◆ centi

typedef ratio<1, 100> std::centi

Definition at line 559 of file ratio.

◆ deca

typedef ratio< 10, 1> std::deca

Definition at line 561 of file ratio.

◆ deci

typedef ratio<1, 10> std::deci

Definition at line 560 of file ratio.

◆ exa

typedef ratio< 1000000000000000000, 1> std::exa

Definition at line 568 of file ratio.

◆ femto

typedef ratio<1, 1000000000000000> std::femto

Definition at line 554 of file ratio.

◆ giga

typedef ratio< 1000000000, 1> std::giga

Definition at line 565 of file ratio.

◆ hecto

typedef ratio< 100, 1> std::hecto

Definition at line 562 of file ratio.

◆ kilo

typedef ratio< 1000, 1> std::kilo

Definition at line 563 of file ratio.

◆ mega

typedef ratio< 1000000, 1> std::mega

Definition at line 564 of file ratio.

◆ micro

typedef ratio<1, 1000000> std::micro

Definition at line 557 of file ratio.

◆ milli

typedef ratio<1, 1000> std::milli

Definition at line 558 of file ratio.

◆ nano

typedef ratio<1, 1000000000> std::nano

Definition at line 556 of file ratio.

◆ peta

typedef ratio< 1000000000000000, 1> std::peta

Definition at line 567 of file ratio.

◆ pico

typedef ratio<1, 1000000000000> std::pico

Definition at line 555 of file ratio.

◆ ratio_add

template<typename _R1 , typename _R2 >
using std::ratio_add = typedef typename __ratio_add<_R1, _R2>::type

ratio_add

Definition at line 525 of file ratio.

◆ ratio_divide

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

ratio_divide

Definition at line 347 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 320 of file ratio.

◆ ratio_subtract

template<typename _R1 , typename _R2 >
using std::ratio_subtract = typedef typename __ratio_subtract<_R1, _R2>::type

ratio_subtract

Definition at line 550 of file ratio.

◆ tera

typedef ratio< 1000000000000, 1> std::tera

Definition at line 566 of file ratio.

Variable Documentation

◆ den

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

Definition at line 276 of file ratio.

◆ num

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

Definition at line 273 of file ratio.

◆ ratio_equal_v

template<typename _R1 , typename _R2 >
constexpr bool std::ratio_equal_v
inlineconstexpr

Definition at line 421 of file ratio.

◆ ratio_greater_equal_v

template<typename _R1 , typename _R2 >
constexpr bool std::ratio_greater_equal_v
inlineconstexpr

Definition at line 432 of file ratio.

◆ ratio_greater_v

template<typename _R1 , typename _R2 >
constexpr bool std::ratio_greater_v
inlineconstexpr

Definition at line 430 of file ratio.

◆ ratio_less_equal_v

template<typename _R1 , typename _R2 >
constexpr bool std::ratio_less_equal_v
inlineconstexpr

Definition at line 427 of file ratio.

◆ ratio_less_v

template<typename _R1 , typename _R2 >
constexpr bool std::ratio_less_v
inlineconstexpr

Definition at line 425 of file ratio.

◆ ratio_not_equal_v

template<typename _R1 , typename _R2 >
constexpr bool std::ratio_not_equal_v
inlineconstexpr

Definition at line 423 of file ratio.