Namespaces
Variants
Views
Actions

Compile-time rational arithmetic

From cppreference.com
< cpp‎ | numeric
Revision as of 08:09, 17 August 2011 by P12 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:cpp/utility/ratio/sidebar

Contents

ratio

ratio arithmetic

(C++11)
adds two ratio objects
(class template)
subtracts two ratio objects
(class template)
multiplies two ratio objects
(class template)
divides two ratio objects
(class template)

ratio comparison

compares two ratio objects for equality
(class template)
compares two ratio objects for inequality
(class template)
compares two ratio objects for less than
(class template)
compares two ratio objects for less than or equal to
(class template)
compares two ratio objects for greater than
(class template)
compares two ratio objects for greater than or equal to
(class template)

Convenience SI typedefs

typedef std::ratio<1, 1000000000000000000000000> yocto; //see below

typedef std::ratio<1, 1000000000000000000000> zepto;    //see below
typedef std::ratio<1, 1000000000000000000> atto;
typedef std::ratio<1, 1000000000000000> femto;
typedef std::ratio<1, 1000000000000> pico;
typedef std::ratio<1, 1000000000> nano;
typedef std::ratio<1, 1000000> micro;
typedef std::ratio<1, 1000> milli;
typedef std::ratio<1, 100> centi;
typedef std::ratio<1, 10> deci;
typedef std::ratio<10, 1> deca;
typedef std::ratio<100, 1> hecto;
typedef std::ratio<1000, 1> kilo;
typedef std::ratio<1000000, 1> mega;
typedef std::ratio<1000000000, 1> giga;
typedef std::ratio<1000000000000, 1> tera;
typedef std::ratio<1000000000000000, 1> peta;
typedef std::ratio<1000000000000000000, 1> exa;
typedef std::ratio<1000000000000000000000, 1> zetta;    //see below

typedef std::ratio<1000000000000000000000000, 1> yotta; //see below
Template:mark c++11 feature