<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>libstdc++: std::ratio< _Num, _Den > Struct Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libstdc++ </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('a00950.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-static-attribs">Static Public Attributes</a> | <a href="a03274.html">List of all members</a> </div> <div class="headertitle"> <div class="title">std::ratio< _Num, _Den > Struct Template Reference<div class="ingroups"><a class="el" href="a01698.html">Rational Arithmetic</a></div></div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:ga2c2933c16c723af4d77eb939438617ca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2c2933c16c723af4d77eb939438617ca"></a> typedef <a class="el" href="a00950.html">ratio</a>< num, den > </td><td class="memItemRight" valign="bottom"><b>type</b></td></tr> <tr class="separator:ga2c2933c16c723af4d77eb939438617ca"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a> Static Public Attributes</h2></td></tr> <tr class="memitem:ga74b18a02929d0dfc37fc30b390390a8d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga74b18a02929d0dfc37fc30b390390a8d"></a> static constexpr intmax_t </td><td class="memItemRight" valign="bottom"><b>den</b></td></tr> <tr class="separator:ga74b18a02929d0dfc37fc30b390390a8d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gac2dc623161a14481407fa34d8c469e45"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac2dc623161a14481407fa34d8c469e45"></a> static constexpr intmax_t </td><td class="memItemRight" valign="bottom"><b>num</b></td></tr> <tr class="separator:gac2dc623161a14481407fa34d8c469e45"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template<intmax_t _Num, intmax_t _Den = 1><br/> struct std::ratio< _Num, _Den ></h3> <p>Provides compile-time rational arithmetic. </p> <p>This class template represents any finite rational number with a numerator and denominator representable by compile-time constants of type intmax_t. The ratio is simplified when instantiated.</p> <p>For example: </p> <div class="fragment"><div class="line">* <a class="code" href="a00950.html">std::ratio</a><7,-21>::num == -1;</div> <div class="line">* <a class="code" href="a00950.html">std::ratio</a><7,-21>::den == 3;</div> <div class="line">* </div> </div><!-- fragment --> <p>Definition at line <a class="el" href="a01460_source.html#l00263">263</a> of file <a class="el" href="a01460_source.html">ratio</a>.</p> </div><hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="a01460_source.html">ratio</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="a01662.html">std</a></li><li class="navelem"><a class="el" href="a00950.html">ratio</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li> </ul> </div> </body> </html>