From cppreference.com
This header is part of the
compile-time rational arithmetic
library.
Classes
(C++11)
represents exact rational fraction
(class template)
Arithmetic
(C++11)
adds two ratio objects at compile-time
(alias template)
(C++11)
subtracts two ratio objects at compile-time
(alias template)
(C++11)
multiplies two ratio objects at compile-time
(alias template)
(C++11)
divides two ratio objects at compile-time
(alias template)
Comparison
(C++11)
compares two ratio objects for equality at compile-time
(class template)
(C++11)
compares two ratio objects for inequality at compile-time
(class template)
(C++11)
compares two ratio objects for less than at compile-time
(class template)
(C++11)
compares two ratio objects for less than or equal to at compile-time
(class template)
(C++11)
compares two ratio objects for greater than at compile-time
(class template)
(C++11)
compares two ratio objects for greater than or equal to at compile-time
(class template)
Type Aliases quecto(C++26)std::ratio<1,1000000000000000000000000000000>, if
can represent the denominator ronto(C++26)std::ratio<1,1000000000000000000000000000>, if
can represent the denominator yoctostd::ratio<1,1000000000000000000000000>, if
can represent the denominator zeptostd::ratio<1,1000000000000000000000>, if
can represent the denominator attostd::ratio<1,1000000000000000000>femtostd::ratio<1,1000000000000000>picostd::ratio<1,1000000000000>nanostd::ratio<1,1000000000>microstd::ratio<1,1000000>millistd::ratio<1,1000>centistd::ratio<1,100>decistd::ratio<1,10>decastd::ratio<10,1>hectostd::ratio<100,1>kilostd::ratio<1000,1>megastd::ratio<1000000,1>gigastd::ratio<1000000000,1>terastd::ratio<1000000000000,1>petastd::ratio<1000000000000000,1>exastd::ratio<1000000000000000000,1>zettastd::ratio<1000000000000000000000,1>, if
can represent the numerator yottastd::ratio<1000000000000000000000000,1>, if
can represent the numerator ronna(C++26)std::ratio<1000000000000000000000000000,1>, if
can represent the numerator quetta(C++26)std::ratio<1000000000000000000000000000000,1>, if
can represent the numerator Synopsis
namespacestd{// class template ratiotemplate<intmax_tN,intmax_tD=1>classratio{public:typedefratio<num,den>type;staticconstexprintmax_tnum;staticconstexprintmax_tden;};// ratio arithmetic template<classR1,classR2>usingratio_add=/*ratio*/;template<classR1,classR2>usingratio_subtract=/*ratio*/;template<classR1,classR2>usingratio_multiply=/*ratio*/;template<classR1,classR2>usingratio_divide=/*ratio*/;// ratio comparison template<classR1,classR2>structratio_equal;template<classR1,classR2>structratio_not_equal;template<classR1,classR2>structratio_less;template<classR1,classR2>structratio_less_equal;template<classR1,classR2>structratio_greater;template<classR1,classR2>structratio_greater_equal;// convenience SI typedefstypedefratio<1,1000000000000000000000000000000>quecto;typedefratio<1,1000000000000000000000000000>ronto;typedefratio<1,1000000000000000000000000>yocto;typedefratio<1,1000000000000000000000>zepto;typedefratio<1,1000000000000000000>atto;typedefratio<1,1000000000000000>femto;typedefratio<1,1000000000000>pico;typedefratio<1,1000000000>nano;typedefratio<1,1000000>micro;typedefratio<1,1000>milli;typedefratio<1,100>centi;typedefratio<1,10>deci;typedefratio<10,1>deca;typedefratio<100,1>hecto;typedefratio<1000,1>kilo;typedefratio<1000000,1>mega;typedefratio<1000000000,1>giga;typedefratio<1000000000000,1>tera;typedefratio<1000000000000000,1>peta;typedefratio<1000000000000000000,1>exa;typedefratio<1000000000000000000000,1>zetta;typedefratio<1000000000000000000000000,1>yotta;typedefratio<1000000000000000000000000000,1>ronna;typedefratio<1000000000000000000000000000000,1>quetta;}