 st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio    Defined in header <ratio>         template< 
    st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t Num, 
    st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t Denom = 1 
> class ratio;
    (since C++11)    The class template st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio provides compile-time rational arithmetic support. Each instantiation of this template exactly represents any finite rational number as long as its numerator Num and denominator Denom are representable as compile-time constants of type st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t. In addition, Denom may not be zero and may not be equal to the most negative value.
The static data members num and den representing the numerator and denominator are calculated by dividing Num and Denom by their greatest common divisor. However, two st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio with different Num or Denom are distinct types even if they represent the same rational number (after reduction). A ratio type can be reduced to the lowest terms via its type member: st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<3, 6>8b7c:f320:99b9:690f:4595:cd17:293a:c069type is st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 2>.
Several convenience typedefs that correspond to the SI ratios are provided by the standard library:
   Defined in header <ratio> 
   Type   Definition 
   yocto   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000000000000000000000>, if st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t can represent the denominator 
   zepto   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000000000000000000>, if st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t can represent the denominator 
   atto   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000000000000000> 
   femto   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000000000000> 
   pico   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000000000> 
   nano   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000000> 
   micro   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000000> 
   milli   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 1000> 
   centi   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 100> 
   deci   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1, 10> 
   deca   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<10, 1> 
   hecto   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<100, 1> 
   kilo   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000, 1> 
   mega   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000, 1> 
   giga   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000000, 1> 
   tera   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000000000, 1> 
   peta   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000000000000, 1> 
   exa   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000000000000000, 1> 
   zetta   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000000000000000000, 1>, if st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t can represent the numerator 
   yotta   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<1000000000000000000000000, 1>, if st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t can represent the numerator 
   Member types    Member type   Definition 
   type   st8b7c:f320:99b9:690f:4595:cd17:293a:c069ratio<num, den> 
   Member objects    constexpr intmax_t num
[static]   constexpr value of type st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t equal to sign(Denom) * Num / gcd(Num, Denom)  (public static member constant) 
   constexpr intmax_t den
[static]   constexpr value of type st8b7c:f320:99b9:690f:4595:cd17:293a:c069intmax_t equal to abs(Denom) / gcd(Num, Denom)  (public static member constant) 
   See also    Mathematical constants (C++20)   provides several mathematical constants, such as st8b7c:f320:99b9:690f:4595:cd17:293a:c069numbers8b7c:f320:99b9:690f:4595:cd17:293a:c069 for e  
  

    
{'path': 'public/docs/cpp/numeric/ratio/ratio.html', 'source': 'DevDocs.IO'}