|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67534 - in sandbox/chrono/libs/ratio/doc: . html
From: vicente.botet_at_[hidden]
Date: 2011-01-01 08:23:11
Author: viboes
Date: 2011-01-01 08:23:10 EST (Sat, 01 Jan 2011)
New Revision: 67534
URL: http://svn.boost.org/trac/boost/changeset/67534
Log:
Ratio: Minor doc modifications
Text files modified:
sandbox/chrono/libs/ratio/doc/html/index.html | 895 ++++++++++++++++-----------------------
sandbox/chrono/libs/ratio/doc/ratio.qbk | 162 ++----
2 files changed, 430 insertions(+), 627 deletions(-)
Modified: sandbox/chrono/libs/ratio/doc/html/index.html
==============================================================================
--- sandbox/chrono/libs/ratio/doc/html/index.html (original)
+++ sandbox/chrono/libs/ratio/doc/html/index.html 2011-01-01 08:23:10 EST (Sat, 01 Jan 2011)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Boost.Ratio 1.0.0</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
-<link rel="start" href="index.html" title="Boost.Ratio 1.0.0">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="index.html" title="Boost.Ratio 1.0.0">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -17,7 +17,7 @@
</tr></table>
<hr>
<div class="spirit-nav"></div>
-<div class="article" lang="en">
+<div class="article">
<div class="titlepage">
<div>
<div><h2 class="title">
@@ -37,7 +37,7 @@
<div><p class="copyright">Copyright © 2006 , 2008 Beman Dawes</p></div>
<div><p class="copyright">Copyright © 2009 -2010 Vicente J. Botet Escriba</p></div>
<div><div class="legalnotice">
-<a name="id4987032"></a><p>
+<a name="id683134"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -53,29 +53,29 @@
<dt><span class="section">Motivation</span></dt>
<dt><span class="section">Description</span></dt>
</dl></dd>
-<dt><span class="section"> User's Guide</span></dt>
+<dt><span class="section">User's Guide</span></dt>
<dd><dl>
-<dt><span class="section"> Getting Started</span></dt>
+<dt><span class="section">Getting Started</span></dt>
<dt><span class="section">Tutorial</span></dt>
-<dt><span class="section"> Example</span></dt>
-<dt><span class="section"> External Resources</span></dt>
+<dt><span class="section">Example</span></dt>
+<dt><span class="section">External Resources</span></dt>
</dl></dd>
-<dt><span class="section"> Reference </span></dt>
+<dt><span class="section">Reference </span></dt>
<dd><dl>
-<dt><span class="section"> Header <boost/ratio_fwd.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/ratio_io.hpp>
</span></dt>
+<dt><span class="section">Header <boost/ratio_fwd.hpp>
</span></dt>
+<dt><span class="section">Header <boost/ratio.hpp>
</span></dt>
+<dt><span class="section">Header <boost/ratio_io.hpp>
</span></dt>
</dl></dd>
<dt><span class="section">Appendices</span></dt>
<dd><dl>
-<dt><span class="section"> Appendix A: History</span></dt>
-<dt><span class="section"> Appendix B: Rationale</span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.appendices.implementation"> Appendix C: Implementation
+<dt><span class="section">Appendix A: History</span></dt>
+<dt><span class="section">Appendix B: Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.appendices.implementation">Appendix C: Implementation
Notes</a></span></dt>
-<dt><span class="section"> Appendix D: FAQ</span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.appendices.acknowledgements"> Appendix E:
+<dt><span class="section">Appendix D: FAQ</span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.appendices.acknowledgements">Appendix E:
Acknowledgements</a></span></dt>
-<dt><span class="section"> Appendix F: Future Plans</span></dt>
+<dt><span class="section">Appendix F: Future Plans</span></dt>
</dl></dd>
</dl>
</div>
@@ -88,45 +88,45 @@
Ratio is not part of the Boost libraries.
</p></td></tr>
</table></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_ratio.overview"></a>Overview
+<a name="boost_ratio.overview"></a><a class="link" href="index.html#boost_ratio.overview" title="Overview">Overview</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section">Motivation</span></dt>
<dt><span class="section">Description</span></dt>
</dl></div>
-<a name="boost_ratio.overview.how_to_use_this_documentation"></a><h3>
-<a name="id4948656"></a>
- <a href="index.html#boost_ratio.overview.how_to_use_this_documentation">How to Use
+<a name="boost_ratio.overview.how_to_use_this_documentation"></a><h4>
+<a name="id642537"></a>
+ <a class="link" href="index.html#boost_ratio.overview.how_to_use_this_documentation">How to Use
This Documentation</a>
- </h3>
+ </h4>
<p>
This documentation makes use of the following naming and formatting conventions.
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
Code is in <code class="computeroutput"><span class="identifier">fixed</span> <span class="identifier">width</span>
<span class="identifier">font</span></code> and is syntax-highlighted.
</li>
-<li>
+<li class="listitem">
Replaceable text that you will need to supply is in <em class="replaceable"><code>italics</code></em>.
</li>
-<li>
- Free functions are rendered in the code font followed by (), as in free_function().
+<li class="listitem">
+ Free functions are rendered in the code font followed by <code class="computeroutput"><span class="special">()</span></code>, as in <code class="computeroutput"><span class="identifier">free_function</span><span class="special">()</span></code>.
</li>
-<li>
+<li class="listitem">
If a name refers to a class template, it is specified like this: <code class="computeroutput"><span class="identifier">class_template</span><span class="special"><></span></code>;
that is, it is in code font and its name is followed by <code class="computeroutput"><span class="special"><></span></code>
to indicate that it is a class template.
</li>
-<li>
+<li class="listitem">
If a name refers to a function-like macro, it is specified like this:
<code class="computeroutput"><span class="identifier">MACRO</span><span class="special">()</span></code>;
that is, it is uppercase in code font and its name is followed by <code class="computeroutput"><span class="special">()</span></code> to indicate that it is a function-like
macro. Object-like macros appear without the trailing <code class="computeroutput"><span class="special">()</span></code>.
</li>
-<li>
+<li class="listitem">
Names that refer to <span class="emphasis"><em>concepts</em></span> in the generic programming
sense are specified in CamelCase.
</li>
@@ -148,9 +148,9 @@
</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">ratio</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
</pre>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.overview.motivation"></a>Motivation
+<a name="boost_ratio.overview.motivation"></a><a class="link" href="index.html#boost_ratio.overview.motivation" title="Motivation">Motivation</a>
</h3></div></div></div>
<p>
<span class="bold"><strong>Boost.Ratio</strong></span> aims to implement the compile
@@ -159,60 +159,57 @@
of a good deal of information in this documentation.
</p>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.overview.description"></a>Description
+<a name="boost_ratio.overview.description"></a><a class="link" href="index.html#boost_ratio.overview.description" title="Description">Description</a>
</h3></div></div></div>
<p>
The <span class="bold"><strong>Boost.Ratio</strong></span> library provides:
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
- A class template, <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>, for specifying compile
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ A class template, <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>, for specifying compile
time rational constants such as 1/3 of a nanosecond or the number of
- inches per meter. <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> represents a compile time
+ inches per meter. <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> represents a compile time
ratio of compile time constants with support for compile time arithmetic
with overflow and division by zero protection
</li>
-<li>
+<li class="listitem">
It provides a textual representation of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N</span><span class="special">,</span> <span class="identifier">D</span><span class="special">></span></code> in the form of a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span></code>
which can be useful for I/O.
</li>
</ul></div>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_ratio.users_guide"></a> User's Guide
+<a name="boost_ratio.users_guide"></a><a class="link" href="index.html#boost_ratio.users_guide" title="User's Guide">User's Guide</a>
</h2></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"> Getting Started</span></dt>
-<dd><dl><dt><span class="section"><a href="index.html#boost_ratio.users_guide.getting_started.install"> Installing
+<dt><span class="section">Getting Started</span></dt>
+<dd><dl><dt><span class="section"><a href="index.html#boost_ratio.users_guide.getting_started.install">Installing
Ratio</a></span></dt></dl></dd>
<dt><span class="section">Tutorial</span></dt>
-<dt><span class="section"> Example</span></dt>
+<dt><span class="section">Example</span></dt>
<dd><dl><dt><span class="section">SI units</span></dt></dl></dd>
-<dt><span class="section"> External Resources</span></dt>
+<dt><span class="section">External Resources</span></dt>
</dl></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.users_guide.getting_started"></a> Getting Started
+<a name="boost_ratio.users_guide.getting_started"></a><a class="link" href="index.html#boost_ratio.users_guide.getting_started" title="Getting Started">Getting Started</a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="index.html#boost_ratio.users_guide.getting_started.install"> Installing
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost_ratio.users_guide.getting_started.install">Installing
Ratio</a></span></dt></dl></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.users_guide.getting_started.install"></a><a href="index.html#boost_ratio.users_guide.getting_started.install" title=" Installing
- Ratio"> Installing
+<a name="boost_ratio.users_guide.getting_started.install"></a><a class="link" href="index.html#boost_ratio.users_guide.getting_started.install" title="Installing Ratio">Installing
Ratio</a>
</h4></div></div></div>
-<a name="boost_ratio.users_guide.getting_started.install.getting_boost_ratio_"></a><h5>
-<a name="id4949124"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.getting_boost_ratio_">Getting
+<a name="boost_ratio.users_guide.getting_started.install.getting_boost_ratio_"></a><h6>
+<a name="id641674"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.getting_boost_ratio_">Getting
Boost.Ratio </a>
- </h5>
+ </h6>
<p>
You can get the last stable release of <span class="bold"><strong>Boost.Ratio</strong></span>
by downloading <code class="literal">ratio.zip</code> from the <a href="http://www.boostpro.com/vault/index.php?action=downloadfile&filename=ratio.zip&directory=Math%20-%20Numerics&PHPSESSID=2d7859f3e812c993f5a9e2d9900dfee8" target="_top">Boost
@@ -223,11 +220,11 @@
Sandbox</a> directories boost/ratio and libs/ratio. Just go to here
and follow the instructions there for anonymous SVN access.
</p>
-<a name="boost_ratio.users_guide.getting_started.install.where_to_install_boost_ratio__"></a><h5>
-<a name="id4949194"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.where_to_install_boost_ratio__">Where
+<a name="boost_ratio.users_guide.getting_started.install.where_to_install_boost_ratio__"></a><h6>
+<a name="id641744"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.where_to_install_boost_ratio__">Where
to install Boost.Ratio? </a>
- </h5>
+ </h6>
<p>
The simple way is to decompress (or checkout from SVN) the file in your
BOOST_ROOT directory.
@@ -239,23 +236,23 @@
Jamfile that is able to work in both environements and use the BOOST_ROOT
variable. Any help is welcome.
</p>
-<a name="boost_ratio.users_guide.getting_started.install.building_boost_ratio_"></a><h5>
-<a name="id4949232"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.building_boost_ratio_">Building
+<a name="boost_ratio.users_guide.getting_started.install.building_boost_ratio_"></a><h6>
+<a name="id641781"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.building_boost_ratio_">Building
Boost.Ratio </a>
- </h5>
+ </h6>
<p>
<span class="bold"><strong>Boost.Ratio</strong></span> is a header only library,
so no need to compile anything.
</p>
-<a name="boost_ratio.users_guide.getting_started.install.requirements"></a><h5>
-<a name="id4949262"></a>
- Requirements
- </h5>
+<a name="boost_ratio.users_guide.getting_started.install.requirements"></a><h6>
+<a name="id641812"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.requirements">Requirements</a>
+ </h6>
<p>
<span class="bold"><strong>Boost.Ratio</strong></span> depends on some Boost libraries.
- For these specific parts you must use either Boost version 1.39.0 or the
- version in SVN trunk (even if older versions should works also).
+ For these specific parts you must use either Boost version 1.39.0 or later
+ (even if older versions should works also).
</p>
<p>
In particular, <span class="bold"><strong>Boost.Ratio</strong></span> depends on:
@@ -289,36 +286,36 @@
</p></dd>
</dl>
</div>
-<a name="boost_ratio.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_ratio__emphasis__"></a><h5>
-<a name="id4949441"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_ratio__emphasis__">Building
+<a name="boost_ratio.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_ratio__emphasis__"></a><h6>
+<a name="id641990"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_ratio__emphasis__">Building
an executable that uses <span class="bold"><strong>Boost.Ratio</strong></span> </a>
- </h5>
+ </h6>
<p>
No link is needed.
</p>
-<a name="boost_ratio.users_guide.getting_started.install.exception_safety_"></a><h5>
-<a name="id4949474"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.exception_safety_">Exception
+<a name="boost_ratio.users_guide.getting_started.install.exception_safety_"></a><h6>
+<a name="id642023"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.exception_safety_">Exception
safety </a>
- </h5>
+ </h6>
<p>
All functions in the library are exception-neutral, providing the strong
exception safety guarantee.
</p>
-<a name="boost_ratio.users_guide.getting_started.install.thread_safety_"></a><h5>
-<a name="id4949498"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.thread_safety_">Thread
+<a name="boost_ratio.users_guide.getting_started.install.thread_safety_"></a><h6>
+<a name="id642047"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.thread_safety_">Thread
safety </a>
- </h5>
+ </h6>
<p>
All functions in the library are thread-unsafe except when noted explicitly.
</p>
-<a name="boost_ratio.users_guide.getting_started.install.tested_compilers_"></a><h5>
-<a name="id4949523"></a>
- <a href="index.html#boost_ratio.users_guide.getting_started.install.tested_compilers_">Tested
+<a name="boost_ratio.users_guide.getting_started.install.tested_compilers_"></a><h6>
+<a name="id642073"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.getting_started.install.tested_compilers_">Tested
compilers </a>
- </h5>
+ </h6>
<p>
<span class="bold"><strong>Boost.Ratio</strong></span> should work with an C++03
conforming compiler. The current version has been tested on:
@@ -326,42 +323,42 @@
<p>
Windows with
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
MSVC 10.0
</li>
-<li>
+<li class="listitem">
MSVC 9.0 Express
</li>
-<li>
+<li class="listitem">
MSVC 8.0
</li>
</ul></div>
<p>
Scientific Linux with
</p>
-<div class="itemizedlist"><ul type="disc"><li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
GCC 4.1.2
</li></ul></div>
<p>
Cygwin with
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
GCC 3.4.4
</li>
-<li>
+<li class="listitem">
GCC 4.3.2
</li>
</ul></div>
<p>
MinGW with
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
GCC 4.4.0
</li>
-<li>
+<li class="listitem">
GCC 4.5.0
</li>
</ul></div>
@@ -395,63 +392,51 @@
</table></div>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.users_guide.tutorial"></a>Tutorial
+<a name="boost_ratio.users_guide.tutorial"></a><a class="link" href="index.html#boost_ratio.users_guide.tutorial" title="Tutorial">Tutorial</a>
</h3></div></div></div>
-<a name="boost_ratio.users_guide.tutorial.ratio"></a><h4>
-<a name="id4949688"></a>
- Ratio
- </h4>
+<a name="boost_ratio.users_guide.tutorial.ratio"></a><h5>
+<a name="id692873"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.tutorial.ratio">Ratio</a>
+ </h5>
<p>
- <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
is a general purpose utility inspired by Walter Brown allowing one to easily
- and safely compute rational values at compile time. The <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> class catches all errors (such
+ and safely compute rational values at compile time. The <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> class catches all errors (such
as divide by zero and overflow) at compile time. It is used in the duration
and <code class="computeroutput"><span class="identifier">time_point</span></code> classes to
efficiently create units of time. It can also be used in other "quantity"
libraries or anywhere there is a rational constant which is known at compile
time. The use of this utility can greatly reduce the chances of run time
- overflow because the <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> (and any ratios resulting
- from <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic) are always reduced
+ overflow because the <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> (and any ratios resulting
+ from <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic) are always reduced
to lowest terms.
</p>
<p>
- <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
is a template taking two intmax_ts, with the second defaulted to 1. In addition
to copy constructors and assignment, it only has two public members, both
- of which are static const intmax_t. One is the numerator of the <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and the other is the denominator.
- The <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
+ of which are static const intmax_t. One is the numerator of the <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and the other is the denominator.
+ The <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
is always normalized such that it is expressed in lowest terms, and the denominator
is always positive. When the numerator is 0, the denominator is always 1.
</p>
<p>
<span class="bold"><strong>Example:</strong></span>
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">,</span> <span class="number">3</span><span class="special">></span> <span class="identifier">five_thirds</span><span class="special">;</span>
+<pre class="programlisting"><span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">,</span> <span class="number">3</span><span class="special">></span> <span class="identifier">five_thirds</span><span class="special">;</span>
<span class="comment">// five_thirds::num == 5, five_thirds::den == 3
</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">25</span><span class="special">,</span> <span class="number">15</span><span class="special">></span> <span class="identifier">also_five_thirds</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">25</span><span class="special">,</span> <span class="number">15</span><span class="special">></span> <span class="identifier">also_five_thirds</span><span class="special">;</span>
<span class="comment">// also_five_thirds::num == 5, also_five_thirds::den == 3
</span>
<span class="keyword">typedef</span> <span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">five_thirds</span><span class="special">,</span> <span class="identifier">also_five_thirds</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">one</span><span class="special">;</span>
<span class="comment">// one::num == 1, one::den == 1
</span></pre>
<p>
- This facility also includes convenience typedefs for the SI prefixes <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a> through <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">exa</span></code></a> corresponding to their internationally
- recognized definitions (in terms of <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>). This is a tremendous syntactic
+ This facility also includes convenience typedefs for the SI prefixes <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a> through <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">exa</span></code></a> corresponding to their internationally
+ recognized definitions (in terms of <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>). This is a tremendous syntactic
convenience. It will prevent errors in specifying constants as one no longer
has to double count the number of zeros when trying to write millions or
billions.
@@ -459,18 +444,16 @@
<p>
<span class="bold"><strong>Example:</strong></span>
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">giga</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5giga</span><span class="special">;</span>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">giga</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5giga</span><span class="special">;</span>
<span class="comment">// _5giga::num == 5000000000, _5giga::den == 1
</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">nano</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5nano</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">nano</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5nano</span><span class="special">;</span>
<span class="comment">// _5nano::num == 1, _5nano::den == 200000000
</span></pre>
-<a name="boost_ratio.users_guide.tutorial.ratio_i_o"></a><h4>
-<a name="id4942425"></a>
- Ratio I/O
- </h4>
+<a name="boost_ratio.users_guide.tutorial.ratio_i_o"></a><h5>
+<a name="id693396"></a>
+ <a class="link" href="index.html#boost_ratio.users_guide.tutorial.ratio_i_o">Ratio I/O</a>
+ </h5>
<p>
For each <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N</span><span class="special">,</span> <span class="identifier">D</span><span class="special">></span></code> there exists a <code class="computeroutput"><span class="identifier">ratio_string</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N</span><span class="special">,</span>
<span class="identifier">D</span><span class="special">>,</span>
@@ -497,17 +480,17 @@
<p>
<code class="computeroutput"><span class="identifier">ratio_string</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N</span><span class="special">,</span> <span class="identifier">D</span><span class="special">>,</span> <span class="identifier">CharT</span><span class="special">></span></code> is only defined for four character types:
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
<code class="computeroutput"><span class="keyword">char</span></code>: UTF-8
</li>
-<li>
+<li class="listitem">
<code class="computeroutput"><span class="identifier">char16_t</span></code>: UTF-16
</li>
-<li>
+<li class="listitem">
<code class="computeroutput"><span class="identifier">char32_t</span></code>: UTF-32
</li>
-<li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">wchar_t</span></code>: UTF-16 (if wchar_t
is 16 bits) or UTF-32
</li>
@@ -563,14 +546,14 @@
<span class="identifier">ratio_string</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">4</span><span class="special">,</span> <span class="number">6</span><span class="special">>,</span> <span class="keyword">char</span><span class="special">>::</span><span class="identifier">short_name</span><span class="special">()</span> <span class="special">=</span> <span class="special">[</span><span class="number">2</span><span class="special">/</span><span class="number">3</span><span class="special">]</span>
</pre>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.users_guide.Examples"></a> Example
+<a name="boost_ratio.users_guide.Examples"></a><a class="link" href="index.html#boost_ratio.users_guide.Examples" title="Example">Example</a>
</h3></div></div></div>
<div class="toc"><dl><dt><span class="section">SI units</span></dt></dl></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.users_guide.Examples.si_units"></a>SI units
+<a name="boost_ratio.users_guide.Examples.si_units"></a><a class="link" href="index.html#boost_ratio.users_guide.Examples.si_units" title="SI units">SI units</a>
</h4></div></div></div>
<p>
This example illustrates the use of type-safe physics code interoperating
@@ -613,26 +596,18 @@
<p>
Here's a small sampling of length units:
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">meter</span><span class="special">;</span> <span class="comment">// set meter as "unity"
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">centi</span></code></a><span class="special">></span> <span class="identifier">centimeter</span><span class="special">;</span> <span class="comment">// 1/100 meter
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">kilo</span></code></a><span class="special">></span> <span class="identifier">kilometer</span><span class="special">;</span> <span class="comment">// 1000 meters
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">254</span><span class="special">,</span> <span class="number">10000</span><span class="special">></span> <span class="special">></span> <span class="identifier">inch</span><span class="special">;</span> <span class="comment">// 254/10000 meters
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">meter</span><span class="special">;</span> <span class="comment">// set meter as "unity"
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">centi</span></code></a><span class="special">></span> <span class="identifier">centimeter</span><span class="special">;</span> <span class="comment">// 1/100 meter
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">kilo</span></code></a><span class="special">></span> <span class="identifier">kilometer</span><span class="special">;</span> <span class="comment">// 1000 meters
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">254</span><span class="special">,</span> <span class="number">10000</span><span class="special">></span> <span class="special">></span> <span class="identifier">inch</span><span class="special">;</span> <span class="comment">// 254/10000 meters
</span></pre>
<p>
Note that since <code class="computeroutput"><span class="identifier">length</span></code>'s
template parameter is actually a generic ratio type, so we can use boost::ratio
allowing for more complex length units:
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">12</span><span class="special">>,</span> <span class="identifier">inch</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">foot</span><span class="special">;</span> <span class="comment">// 12 inchs
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5280</span><span class="special">>,</span> <span class="identifier">foot</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">mile</span><span class="special">;</span> <span class="comment">// 5280 feet
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">12</span><span class="special">>,</span> <span class="identifier">inch</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">fo
ot</span><span class="special">;</span> <span class="comment">// 12 inchs
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5280</span><span class="special">>,</span> <span class="identifier">foot</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">mile</span><span class=
"special">;</span> <span class="comment">// 5280 feet
</span></pre>
<p>
Now we need a floating point-based definition of seconds:
@@ -642,12 +617,9 @@
<p>
We can even support sub-nanosecond durations:
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">pico</span></code></a><span class="special">></span> <span class="identifier">picosecond</span><span class="special">;</span> <span class="comment">// 10^-12 seconds
-</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a><span class="special">></span> <span class="identifier">femtosecond</span><span class="special">;</span> <span class="comment">// 10^-15 seconds
-</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a><span class="special">></span> <span class="identifier">attosecond</span><span class="special">;</span> <span class="comment">// 10^-18 seconds
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">pico</span></code></a><span class="special">></span> <span class="identifier">picosecond</span><span class="special">;</span> <span class="comment">// 10^-12 seconds
+</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a><span class="special">></span> <span class="identifier">femtosecond</span><span class="special">;</span> <span class="comment">// 10^-15 seconds
+</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a><span class="special">></span> <span class="identifier">attosecond</span><span class="special">;</span> <span class="comment">// 10^-18 seconds
</span></pre>
<p>
Finally, we can write a proof-of-concept of an SI units library, hard-wired
@@ -667,9 +639,7 @@
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
<span class="keyword">double</span> <span class="identifier">q_</span><span class="special">;</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -681,9 +651,7 @@
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
<span class="keyword">double</span> <span class="identifier">q_</span><span class="special">;</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -695,9 +663,7 @@
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
<span class="keyword">double</span> <span class="identifier">q_</span><span class="special">;</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -711,21 +677,11 @@
<p>
That allows us to create some useful SI-based unit types:
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Scalar</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Time</span><span class="special">;</span> <span class="comment">// second
-</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Distance</span><span class="special">;</span> <span class="comment">// meter
-</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><-</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Speed</span><span class="special">;</span> <span class="comment">// meter/second
-</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><-</span><span class="number">2</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Acceleration</span><span class="special">;</span> <span class="comment">// meter/second^2
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Scalar</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Time</span><span class="special">;</span> <span class="comment">// second
+</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Distance</span><span class="special">;</span> <span class="comment">// meter
+</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><-</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Speed</span><span class="special">;</span> <span class="comment">// meter/second
+</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><-</span><span class="number">2</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Acceleration</span><span class="special">;</span> <span class="comment">// meter/second^2
</span></pre>
<p>
To make quantity useful, we need to be able to do arithmetic:
@@ -793,16 +749,10 @@
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">8</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R1</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R2</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">User1</span><span class="special">::</span><span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">,</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">RR</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">8</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R1</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R2</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">User1</span><span class="special">::</span><span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>
</span> <span class="special">>::</span><span class="identifier">type</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">RR</span><span
class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">R1</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">RS</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">RS</span><span class="special">::</span><span class="identifier">num</span> <span class="special"><<</span> <span class="char">'/'</span> <span class="special"><<</span> <span class="identifier">RS</span><span class="special">::</span><span class="identifier">den</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">;</span>
@@ -851,9 +801,9 @@
</p>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.users_guide.ext_references"></a> External Resources
+<a name="boost_ratio.users_guide.ext_references"></a><a class="link" href="index.html#boost_ratio.users_guide.ext_references" title="External Resources">External Resources</a>
</h3></div></div></div>
<div class="variablelist">
<p class="title"><b></b></p>
@@ -879,32 +829,30 @@
</div>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_ratio.reference"></a> Reference
+<a name="boost_ratio.reference"></a><a class="link" href="index.html#boost_ratio.reference" title="Reference">Reference </a>
</h2></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"> Header <boost/ratio_fwd.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
+<dt><span class="section">Header <boost/ratio_fwd.hpp>
</span></dt>
+<dt><span class="section">Header <boost/ratio.hpp>
</span></dt>
<dd><dl>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.conf"> Configuration
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.conf">Configuration
Macros</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio"> Class Template
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio">Class Template
<code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic">
- <code class="computeroutput"><span class="identifier">ratio</span></code> Arithmetic</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison">
- <code class="computeroutput"><span class="identifier">ratio</span></code> Comparison</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs">
- SI typedefs</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.limitations"> Limitations
+<dt><span class="section">ratio
Arithmetic</span></dt>
+<dt><span class="section">ratio
Comparison</span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs">SI
+ typedefs</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.limitations">Limitations
and Extensions</a></span></dt>
</dl></dd>
-<dt><span class="section"> Header <boost/ratio_io.hpp>
</span></dt>
+<dt><span class="section">Header <boost/ratio_io.hpp>
</span></dt>
</dl></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.reference.ratio_fwdhpp"></a> Header <boost/ratio_fwd.hpp>
+<a name="boost_ratio.reference.ratio_fwdhpp"></a><a class="link" href="index.html#boost_ratio.reference.ratio_fwdhpp" title="Header <boost/ratio_fwd.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">ratio_fwd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
</h3></div></div></div>
<p>
This header provides forward declarations for the <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">ratio</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
@@ -912,125 +860,90 @@
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span> <span class="special">=</span> <span class="number">1</span><span class="special">></span> <span class="keyword">class</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span> <span class="special">=</span> <span class="number">1</span><span class="special">></span> <span class="keyword">class</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">;</span>
<span class="comment">// ratio arithmetic
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="
- ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_add</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="
- ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_subtract</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="
- ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_multiply</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="
- ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_divide</span></code></a><span class="special">;</span>
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_add</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_subtract</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_multiply</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_divide</span></code></a><span class="special">;</span>
<span class="comment">// ratio comparison
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_equal</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_not_equal</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_less</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_less_equal</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_greater</span></code></a><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_greater_equal</span></code></a><span class="special">;</span>
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_equal</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_not_equal</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_less</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_less_equal</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_greater</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio_greater_equal</span></code></a><span class="special">;</span>
<span class="comment">// convenience SI typedefs
-</span> <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">pico</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">nano</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">micro</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">milli</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">centi</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">deci</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">deca</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">hecto</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">kilo</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">mega</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">giga</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">tera</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">peta</span></code></a><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs"><code class="computeroutput"><span class="identifier">exa</span></code></a><span class="special">;</span>
+</span> <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">pico</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">nano</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">micro</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">milli</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">centi</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">deci</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">deca</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">hecto</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">kilo</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">mega</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">giga</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">tera</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">peta</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs"><code class="computeroutput"><span class="identifier">exa</span></code></a><span class="special">;</span>
<span class="special">}</span>
</pre>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.reference.ratio_hpp"></a> Header <boost/ratio.hpp>
+<a name="boost_ratio.reference.ratio_hpp"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp" title="Header <boost/ratio.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">ratio</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.conf"> Configuration
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.conf">Configuration
Macros</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio"> Class Template
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio">Class Template
<code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
-<dd><dl><dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio.ca"> Construction
+<dd><dl><dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio.ca">Construction
and Assignment</a></span></dt></dl></dd>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic">
- <code class="computeroutput"><span class="identifier">ratio</span></code> Arithmetic</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison">
- <code class="computeroutput"><span class="identifier">ratio</span></code> Comparison</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs">
- SI typedefs</a></span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.limitations"> Limitations
+<dt><span class="section">ratio
Arithmetic</span></dt>
+<dt><span class="section">ratio
Comparison</span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs">SI
+ typedefs</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.limitations">Limitations
and Extensions</a></span></dt>
</dl></div>
<p>
- <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>
is a facility which is useful in specifying compile time rational constants.
Compile time rational arithmetic is supported with protection against overflow
and divide by zero. Such a facility is very handy when needing to efficiently
represent 1/3 of a nanosecond, or specifying an inch in terms of meters (for
- example 254/10000 meters - which <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> will reduce to 127/5000 meters).
+ example 254/10000 meters - which <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> will reduce to 127/5000 meters).
</p>
<pre class="programlisting"><span class="comment">// configuration macros
-</span><span class="preprocessor">#define</span> <a href="index.html#boost_ratio.reference.ratio_hpp.conf" title=" Configuration
- Macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_STATIC_ASSERT</span></code></a>
-<span class="preprocessor">#define</span> <a href="index.html#boost_ratio.reference.ratio_hpp.conf" title=" Configuration
- Macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_MPL_ASSERT</span></code></a>
-<span class="preprocessor">#define</span> <a href="index.html#boost_ratio.reference.ratio_hpp.conf" title=" Configuration
- Macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_ARRAY_ASSERT</span></code></a>
+</span><span class="preprocessor">#define</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.conf" title="Configuration Macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_STATIC_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.conf" title="Configuration Macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_MPL_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.conf" title="Configuration Macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_ARRAY_ASSERT</span></code></a>
</pre>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.reference.ratio_hpp.conf"></a><a href="index.html#boost_ratio.reference.ratio_hpp.conf" title=" Configuration
- Macros"> Configuration
+<a name="boost_ratio.reference.ratio_hpp.conf"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.conf" title="Configuration Macros">Configuration
Macros</a>
</h4></div></div></div>
<p>
When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static
assertions are reported. Define
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
BOOST_RATIO_USES_STATIC_ASSERT to use Boost.StaticAssert
</li>
-<li>
+<li class="listitem">
BOOST_RATIO_USES_MPL_ASSERT to use Boost.MPL static assertions
</li>
-<li>
+<li class="listitem">
BOOST_RATIO_USES_RATIO_ASSERT to use <span class="bold"><strong>Boost.Ratio</strong></span>
static assertions
</li>
@@ -1055,13 +968,12 @@
assertion will appear in some form in the compiler diagnostic output.
</p>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.reference.ratio_hpp.ratio"></a><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"> Class Template
+<a name="boost_ratio.reference.ratio_hpp.ratio"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>">Class Template
<code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a>
</h4></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio.ca"> Construction
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio.ca">Construction
and Assignment</a></span></dt></dl></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span><span class="special">></span>
<span class="keyword">class</span> <span class="identifier">ratio</span> <span class="special">{</span>
@@ -1080,8 +992,7 @@
<span class="special">};</span>
</pre>
<p>
- A diagnostic will be emitted if <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is instantiated with <code class="computeroutput"><span class="identifier">D</span> <span class="special">==</span> <span class="number">0</span></code>, or if the absolute value of <code class="computeroutput"><span class="identifier">N</span></code> or <code class="computeroutput"><span class="identifier">D</span></code>
+ A diagnostic will be emitted if <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is instantiated with <code class="computeroutput"><span class="identifier">D</span> <span class="special">==</span> <span class="number">0</span></code>, or if the absolute value of <code class="computeroutput"><span class="identifier">N</span></code> or <code class="computeroutput"><span class="identifier">D</span></code>
can not be represented. <span class="bold"><strong>Note:</strong></span> These rules
ensure that infinite ratios are avoided and that for any negative input,
there exists a representable value of its absolute value which is positive.
@@ -1094,44 +1005,35 @@
absolute value and of <code class="computeroutput"><span class="identifier">D</span></code>'s
absolute value. Then:
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
<code class="computeroutput"><span class="identifier">num</span></code> has the value
<code class="computeroutput"><span class="identifier">sign</span><span class="special">(</span><span class="identifier">N</span><span class="special">)*</span><span class="identifier">sign</span><span class="special">(</span><span class="identifier">D</span><span class="special">)*</span><span class="identifier">abs</span><span class="special">(</span><span class="identifier">N</span><span class="special">)/</span><span class="identifier">gcd</span></code>.
</li>
-<li>
+<li class="listitem">
<code class="computeroutput"><span class="identifier">den</span></code> has the value
<code class="computeroutput"><span class="identifier">abs</span><span class="special">(</span><span class="identifier">D</span><span class="special">)/</span><span class="identifier">gcd</span></code>.
</li>
</ul></div>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- denotes the normalized form of this <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> type. It should be used
+ denotes the normalized form of this <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> type. It should be used
when the normalized form of the template arguments are required, since
the arguments are not necessarily normalized.
</p>
<p>
- Two <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> classes <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">></span></code> and <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">></span></code> have the same normalized form if <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">>::</span><span class="identifier">type</span></code> is the same type as <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">>::</span><span class="identifier">type</span></code>
+ Two <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> classes <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">></span></code> and <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">></span></code> have the same normalized form if <c
ode class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">>::</span><span class="identifier">type</span></code> is the same type as <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">>::</span><span class="identifier">type</span></code>
</p>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_ratio.reference.ratio_hpp.ratio.ca"></a><a href="index.html#boost_ratio.reference.ratio_hpp.ratio.ca" title=" Construction
- and Assignment"> Construction
+<a name="boost_ratio.reference.ratio_hpp.ratio.ca"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio.ca" title="Construction and Assignment">Construction
and Assignment</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">D2</span><span class="special">></span>
- <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
+ <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
</pre>
<p>
- <span class="bold"><strong>Effects:</strong></span> Constructs a <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> object.
+ <span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> object.
</p>
<p>
<span class="bold"><strong>Remarks:</strong></span> This constructor will not participate
@@ -1139,13 +1041,10 @@
has the same normalized form as <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">D2</span><span class="special">></span>
- <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
</pre>
<p>
- <span class="bold"><strong>Effects:</strong></span> Assigns a <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> object.
+ <span class="bold"><strong>Effects:</strong></span> Assigns a <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> object.
</p>
<p>
<span class="bold"><strong>Returns:</strong></span> *this.
@@ -1157,82 +1056,73 @@
</p>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic"></a><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="
- ratio Arithmetic">
- <code class="computeroutput"><span class="identifier">ratio</span></code> Arithmetic</a>
+<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio</span></code> Arithmetic</a>
</h4></div></div></div>
<p>
For each of the class templates in this section, each template parameter
refers to a <code class="computeroutput"><span class="identifier">ratio</span></code>. If the
- implementation is unable to form the indicated <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> due to overflow, a diagnostic
+ implementation is unable to form the indicated <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> due to overflow, a diagnostic
will be issued.
</p>
-<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_add__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5007916"></a>
- ratio_add<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_add__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id705873"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_add__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_add</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_add</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">+</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">+</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier
">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
-<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_subtract__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5008222"></a>
- ratio_subtract<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_subtract__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id706179"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_subtract__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_subtract</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_subtract</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">-</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">-</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier
">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
-<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_multiply__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5008528"></a>
- ratio_multiply<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_multiply__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id706485"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_multiply__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_multiply</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_multiply</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
-<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_divide__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5008795"></a>
- ratio_divide<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_divide__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id706752"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic._code__phrase_role__identifier__ratio_divide__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_divide</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_divide</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison"></a><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="
- ratio Comparison">
- <code class="computeroutput"><span class="identifier">ratio</span></code> Comparison</a>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison" title="ratio Comparison"><code class="computeroutput"><span class="identifier">ratio</span></code> Comparison</a>
</h4></div></div></div>
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5009090"></a>
- ratio_equal<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id707045"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_equal__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_equal</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_equal</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="special">></span> <span class="special">{};</span>
</pre>
@@ -1240,17 +1130,17 @@
If R1::num <code class="literal">= R2::num && R1::den =</code> R2::den, ratio_equal
derives from true_type, else derives from false_type.
</p>
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_not_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5009273"></a>
- ratio_not_equal<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_not_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id707228"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_not_equal__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_not_equal</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_not_equal</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">!</span><span class="identifier">ratio_equal</span><span class="special"><</span><span class="identifier">R1</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">></span> <span class="special">{};</span>
</pre>
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_less__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5009461"></a>
- ratio_less<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_less__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id707417"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_less__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_less</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">ratio_less</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="special">></span> <span class="special">{};</span>
@@ -1259,33 +1149,32 @@
If R1::num * R2::den < R2::num * R1::den, ratio_less derives from true_type,
else derives from false_type.
</p>
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_less_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5009641"></a>
- ratio_less_equal<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_less_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id707596"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_less_equal__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_less_equal</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_less_equal</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">!</span><span class="identifier">ratio_less</span><span class="special"><</span><span class="identifier">R2</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">>::</span><span class="identifier">value</span><span class="special">></span> <span class="special">{};</span>
</pre>
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_greater__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5009830"></a>
- ratio_greater<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_greater__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id707785"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_greater__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_greater</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="identifier">ratio_less</span><span class="special"><</span><span class="identifier">R2</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">>::</span><span class="identifier">value</span><span class="special">></span> <span class="special">{};</span>
</pre>
-<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_greater_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h5>
-<a name="id5010016"></a>
- ratio_greater_equal<>
- </h5>
+<a name="boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_greater_equal__phrase__phrase_role__special___lt__gt___phrase___code_"></a><h6>
+<a name="id707970"></a>
+ <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_comparison._code__phrase_role__identifier__ratio_greater_equal__phrase__phrase_role__special___lt__gt___phrase___code_"><code class="computeroutput"><span class="identifier">ratio_greater_equal</span><span class="special"><></span></code></a>
+ </h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater_equal</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">!</span><span class="identifier">ratio_less</span><span class="special"><</span><span class="identifier">R1</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">></span> <span class="special">{};</span>
</pre>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.reference.ratio_hpp.ratio_si_typedefs"></a><a href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="
- SI typedefs">
- SI typedefs</a>
+<a name="boost_ratio.reference.ratio_hpp.ratio_si_typedefs"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_si_typedefs" title="SI typedefs">SI
+ typedefs</a>
</h4></div></div></div>
<p>
The <a href="http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes" target="_top">International
@@ -1295,65 +1184,48 @@
and <code class="computeroutput"><span class="identifier">yotta</span></code>
</p>
<pre class="programlisting"><span class="comment">// convenience SI typedefs
-</span><span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
-<span class="keyword">typedef</span> <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
+</span><span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
</pre>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.reference.ratio_hpp.limitations"></a><a href="index.html#boost_ratio.reference.ratio_hpp.limitations" title=" Limitations
- and Extensions"> Limitations
+<a name="boost_ratio.reference.ratio_hpp.limitations"></a><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.limitations" title="Limitations and Extensions">Limitations
and Extensions</a>
</h4></div></div></div>
<p>
The following are limitations of Boost.Ratio relative to the specification
in the C++0x draft standard:
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
Four of the SI units typedefs -- <code class="computeroutput"><span class="identifier">yocto</span></code>,
<code class="computeroutput"><span class="identifier">zepto</span></code>, <code class="computeroutput"><span class="identifier">zetta</span></code>, and <code class="computeroutput"><span class="identifier">yotta</span></code>
-- are to be conditionally supported, if the range of <code class="computeroutput"><span class="identifier">intmax_t</span></code> allows, but are not supported
by <span class="bold"><strong>Boost.Ratio</strong></span>.
</li>
-<li>
+<li class="listitem">
Ratio values should be of type static <code class="computeroutput"><span class="identifier">constexpr</span>
<span class="identifier">intmax_t</span></code> (see <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3135.html#1121" target="_top">Ratio
values should be constexpr</a>), but no compiler supports <code class="computeroutput"><span class="identifier">constexpr</span></code> today, so <span class="bold"><strong>Boost.Ratio</strong></span>
uses <code class="computeroutput"><span class="keyword">static</span> <span class="keyword">const</span>
<span class="identifier">intmax_t</span></code> instead.
</li>
-<li>
+<li class="listitem">
Rational arithmetic should use template aliases (see <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3134.html#921" target="_top">Rational
Arithmetic should use template aliases</a>), but those are not
available in C++03, so inheritance is used instead.
@@ -1367,9 +1239,9 @@
</p>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.reference.ratio_io_hpp"></a> Header <boost/ratio_io.hpp>
+<a name="boost_ratio.reference.ratio_io_hpp"></a><a class="link" href="index.html#boost_ratio.reference.ratio_io_hpp" title="Header <boost/ratio_io.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">ratio_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
</h3></div></div></div>
<p>
This header provides <code class="computeroutput"><span class="identifier">ratio_string</span><span class="special"><></span></code> which can generate a textual representation
@@ -1390,40 +1262,40 @@
</pre>
</div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_ratio.appendices"></a>Appendices
+<a name="boost_ratio.appendices"></a><a class="link" href="index.html#boost_ratio.appendices" title="Appendices">Appendices</a>
</h2></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"> Appendix A: History</span></dt>
+<dt><span class="section">Appendix A: History</span></dt>
<dd><dl><dt><span class="section">Version 1.0.0, ?? ??, 2010 </span></dt></dl></dd>
-<dt><span class="section"> Appendix B: Rationale</span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.appendices.implementation"> Appendix C: Implementation
+<dt><span class="section">Appendix B: Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.appendices.implementation">Appendix C: Implementation
Notes</a></span></dt>
-<dt><span class="section"> Appendix D: FAQ</span></dt>
-<dt><span class="section"><a href="index.html#boost_ratio.appendices.acknowledgements"> Appendix E:
+<dt><span class="section">Appendix D: FAQ</span></dt>
+<dt><span class="section"><a href="index.html#boost_ratio.appendices.acknowledgements">Appendix E:
Acknowledgements</a></span></dt>
-<dt><span class="section"> Appendix F: Future Plans</span></dt>
+<dt><span class="section">Appendix F: Future Plans</span></dt>
</dl></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.history"></a> Appendix A: History
+<a name="boost_ratio.appendices.history"></a><a class="link" href="index.html#boost_ratio.appendices.history" title="Appendix A: History">Appendix A: History</a>
</h3></div></div></div>
<div class="toc"><dl><dt><span class="section">Version 1.0.0, ?? ??, 2010 </span></dt></dl></div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
-<a name="boost_ratio.appendices.history.__version_1_0_0_________2010__"></a>Version 1.0.0, ?? ??, 2010
+<div class="section"><div class="titlepage"><div><div><h4 class="title">
+<a name="boost_ratio.appendices.history.__version_1_0_0_________2010__"></a><a class="link" href="index.html#boost_ratio.appendices.history.__version_1_0_0_________2010__" title="Version 1.0.0, ?? ??, 2010"><span class="bold"><strong>Version 1.0.0, ?? ??, 2010</strong></span> </a>
</h4></div></div></div></div>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.rationale"></a> Appendix B: Rationale
+<a name="boost_ratio.appendices.rationale"></a><a class="link" href="index.html#boost_ratio.appendices.rationale" title="Appendix B: Rationale">Appendix B: Rationale</a>
</h3></div></div></div>
-<a name="boost_ratio.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form"></a><h4>
-<a name="id5011739"></a>
- <a href="index.html#boost_ratio.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form">Why
+<a name="boost_ratio.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form"></a><h5>
+<a name="id709693"></a>
+ <a class="link" href="index.html#boost_ratio.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form">Why
ratio needs CopyConstruction and Assignment from ratios having the same normalized
form</a>
- </h4>
+ </h5>
<p>
Current N3000 doesn't allows to copy-construct or
assign ratio instances of ratio classes having the same normalized form.
@@ -1431,82 +1303,42 @@
<p>
This simple example
</p>
-<pre class="programlisting"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
-<a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">></span> <span class="identifier">r2</span><span class="special">;</span>
+<pre class="programlisting"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
+<a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">></span> <span class="identifier">r2</span><span class="special">;</span>
<span class="identifier">r1</span> <span class="special">=</span> <span class="identifier">r2</span><span class="special">;</span> <span class="comment">// (1)
</span></pre>
<p>
fails to compile in (1). Other example
</p>
-<pre class="programlisting"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
-<span class="identifier">ratio_subtract</span><span class="special"><</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">>,</span><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="special">></span> <span class="identifier">r2</span><span class="special">=</span><span class="identifier">r1</span><span class="special">;</span> <span class="comment">// (2)
+<pre class="programlisting"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
+<a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_subtract</span></code></a><span class="special"><</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">>,</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="special">></span> <span class="identifier">r2</span><span class="special">=</span><span class="id
entifier">r1</span><span class="special">;</span> <span class="comment">// (2)
</span></pre>
<p>
- The type of ratio<span class="underline">subtract<</span><span class="underline">ratio</span><span class="underline"><2,3>,</span><span class="underline">ratio</span>_<1,3> > could be <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><3,9> so the compilation
- could fail in (2). It could also be <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><1,3> and the compilation
+ The type of <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio_arithmetic" title="ratio Arithmetic"><code class="computeroutput"><span class="identifier">ratio_subtract</span></code></a><span class="special"><</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">>,</span><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="special">></span></code>
+ could be <code class="computeroutput"><a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">></span></code> so the compilation could fail in (2).
+ It could also be <a class="link" href="index.html#boost_ratio.reference.ratio_hpp.ratio" title="Class Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><1,3> and the compilation
succeeds.
</p>
-<a name="boost_ratio.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
-<a name="id5012144"></a>
- <a href="index.html#boost_ratio.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type">Why
+<a name="boost_ratio.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h5>
+<a name="id710212"></a>
+ <a class="link" href="index.html#boost_ratio.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type">Why
ratio needs the nested normalizer typedef type</a>
- </h4>
+ </h5>
<p>
The current resolution of issue LWG 1281 acknowledges the need for a nested
type typedef, so Boost.Ratio is tracking the likely final version of std::ratio.
</p>
-<p>
- [/ In N3000 20.4.2 and similar clauses
- </p>
-<p>
- <span class="emphasis"><em>3 The nested typedef type shall be a synonym for <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><T1, T2> where T1 has
- the value R1::num * R2::den - R2::num * R1::den and T2 has the value R1::den
- * R2::den.</em></span>
- </p>
-<p>
- The meaning of synonym let think that the result should be a normalized ratio
- equivalent to <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><T1, T2>, but there is
- not an explicit definition of what synonym means in this context.
- </p>
-<p>
- If the CopyConstruction and Assignment ([LWG 1281) is not added we need a typedef for
- accessing the normalized ratio, and change 20.4.2 to return only this normalized
- result. In this case the user will need to
- </p>
-<pre class="programlisting"><a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">r1</span><span class="special">;</span>
-<a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">r2</span><span class="special">;</span>
-<span class="identifier">r1</span> <span class="special">=</span> <span class="identifier">r2</span><span class="special">;</span> <span class="comment">// compiles as both types are the same.
-</span></pre>
-<p>
- <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><1,3>::type
- r1; <a href="index.html#boost_ratio.reference.ratio_hpp.ratio" title=" Class Template
- ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><3,9>::type
- r2; r1 = r2; // compiles as both types are the same. ]
- </p>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.implementation"></a><a href="index.html#boost_ratio.appendices.implementation" title=" Appendix C: Implementation
- Notes"> Appendix C: Implementation
+<a name="boost_ratio.appendices.implementation"></a><a class="link" href="index.html#boost_ratio.appendices.implementation" title="Appendix C: Implementation Notes">Appendix C: Implementation
Notes</a>
</h3></div></div></div>
-<a name="boost_ratio.appendices.implementation.how_boost_ratio_manage_with_compile_time_rational_arithmetic_overflow_"></a><h4>
-<a name="id5012452"></a>
- <a href="index.html#boost_ratio.appendices.implementation.how_boost_ratio_manage_with_compile_time_rational_arithmetic_overflow_">How
+<a name="boost_ratio.appendices.implementation.how_boost_ratio_manage_with_compile_time_rational_arithmetic_overflow_"></a><h5>
+<a name="id710262"></a>
+ <a class="link" href="index.html#boost_ratio.appendices.implementation.how_boost_ratio_manage_with_compile_time_rational_arithmetic_overflow_">How
Boost.Ratio manage with compile-time rational arithmetic overflow?</a>
- </h4>
+ </h5>
<p>
When the result is representable, but a simple application of arithmetic
rules would result in overflow, e.g. <code class="computeroutput"><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">INTMAX_MAX</span><span class="special">,</span><span class="number">2</span><span class="special">>,</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">2</span><span class="special">,</span><span class="identifier">INTMAX_MAX</span><span class="special">>></span></code> can be reduced to <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">1</span><span class="special">></span></code>, but
@@ -1517,15 +1349,15 @@
Boost.Ratio implementes some simplifications in order to reduce the possibility
of overflow. The general ideas are:
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
The <code class="computeroutput"><span class="identifier">num</span></code> and <code class="computeroutput"><span class="identifier">den</span></code> <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code> fields are normalized.
</li>
-<li>
+<li class="listitem">
Use the gcd of some of the possible products that can overflow, and simplify
before doing the product.
</li>
-<li>
+<li class="listitem">
Use some equivalences relations that avoid addition or subtraction that
can overflow or underflow.
</li>
@@ -1648,7 +1480,7 @@
<p>
without moving to floating point numbers, two techniques are used:
</p>
-<div class="itemizedlist"><ul type="disc"><li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
First compare the sign of the numerators
</li></ul></div>
<p>
@@ -1658,7 +1490,7 @@
If sign(n1) == sign(n2) the result depends on the following after making
the numerators positive
</p>
-<div class="itemizedlist"><ul type="disc"><li>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
When the sign is equal the technique used is to work with integer division
and modulo when the signs are equal.
</li></ul></div>
@@ -1975,13 +1807,12 @@
</tbody>
</table></div>
</div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.faq"></a> Appendix D: FAQ
+<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<a name="boost_ratio.appendices.faq"></a><a class="link" href="index.html#boost_ratio.appendices.faq" title="Appendix D: FAQ">Appendix D: FAQ</a>
</h3></div></div></div></div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.acknowledgements"></a><a href="index.html#boost_ratio.appendices.acknowledgements" title=" Appendix E:
- Acknowledgements"> Appendix E:
+<a name="boost_ratio.appendices.acknowledgements"></a><a class="link" href="index.html#boost_ratio.appendices.acknowledgements" title="Appendix E: Acknowledgements">Appendix E:
Acknowledgements</a>
</h3></div></div></div>
<p>
@@ -2000,26 +1831,26 @@
The ratio.hpp source has been adapted from the experimental header <code class="computeroutput"><span class="special"><</span><span class="identifier">ratio_io</span><span class="special">></span></code> from Howard Hinnant.
</p>
<p>
- Thanks to Adrew Chinoff for his help polishing the documentation.
+ Thanks to Adrew Chinnoff for his help polishing the documentation.
</p>
</div>
-<div class="section" lang="en">
+<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.todo"></a> Appendix F: Future Plans
+<a name="boost_ratio.appendices.todo"></a><a class="link" href="index.html#boost_ratio.appendices.todo" title="Appendix F: Future Plans">Appendix F: Future Plans</a>
</h3></div></div></div>
-<a name="boost_ratio.appendices.todo.for_later_releases"></a><h4>
-<a name="id5016784"></a>
- <a href="index.html#boost_ratio.appendices.todo.for_later_releases">For later
+<a name="boost_ratio.appendices.todo.for_later_releases"></a><h5>
+<a name="id714596"></a>
+ <a class="link" href="index.html#boost_ratio.appendices.todo.for_later_releases">For later
releases</a>
- </h4>
-<div class="itemizedlist"><ul type="disc">
-<li>
- Use constexpr on compiler providing it
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Use constexpr on compilers providing it
</li>
-<li>
+<li class="listitem">
Use template aliases on compiler providing it
</li>
-<li>
+<li class="listitem">
Implement <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3135.html#3135" target="_top">multiple
arguments</a> ratio arithmetic.
</li>
@@ -2028,7 +1859,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: December 18, 2010 at 11:48:34 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 01, 2011 at 13:09:56 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/chrono/libs/ratio/doc/ratio.qbk
==============================================================================
--- sandbox/chrono/libs/ratio/doc/ratio.qbk (original)
+++ sandbox/chrono/libs/ratio/doc/ratio.qbk 2011-01-01 08:23:10 EST (Sat, 01 Jan 2011)
@@ -28,26 +28,11 @@
[/===============================================]
-[template common_type_link[link_text] [link_text]]
-[def __common_type__ [common_type_link `common_type`]]
-
-[template common_type_macros[link_text] [link_text]]
-
-[template common_type_pp[link_text] [link_text]]
-
-[def __common_type__BOOST_COMMON_TYPE_USES_STATIC_ASSERT [common_type_macros `BOOST_COMMON_TYPE_USES_STATIC_ASSERT`]]
-[def __common_type__BOOST_COMMON_TYPE_USES_MPL_ASSERT [common_type_macros `BOOST_COMMON_TYPE_USES_MPL_ASSERT`]]
-[def __common_type__BOOST_COMMON_TYPE_USES_ARRAY_ASSERT [common_type_macros `BOOST_COMMON_TYPE_USES_ARRAY_ASSERT`]]
-[def __common_type__BOOST_COMMON_TYPE_ARITY [common_type_pp `BOOST_COMMON_TYPE_ARITY`]]
-[def __common_type__BOOST_COMMON_TYPE_DONT_USE_TYPEOF [common_type_pp `BOOST_COMMON_TYPE_DONT_USE_TYPEOF`]]
-
-[def __common_type_spe__ `common_type`]
-[def __time_point__ `time_point`]
-[def __hours__ `hours`]
+[def __time_point `time_point`]
+[def __hours `hours`]
[/===============================================]
-[def __ratio__ [link boost_ratio.reference.ratio_hpp.ratio `ratio`]]
-
+[def __ratio [link boost_ratio.reference.ratio_hpp.ratio `ratio`]]
[template ratio_conf[link_text] [link boost_ratio.reference.ratio_hpp.conf [link_text]]]
@@ -105,7 +90,7 @@
* Code is in `fixed width font` and is syntax-highlighted.
* Replaceable text that you will need to supply is in [~italics].
-* Free functions are rendered in the code font followed by (), as in free_function().
+* Free functions are rendered in the code font followed by `()`, as in `free_function()`.
* If a name refers to a class template, it is specified like this: `class_template<>`; that is, it is in code font and its name is followed by `<>` to indicate that it is a class template.
* If a name refers to a function-like macro, it is specified like this: `MACRO()`;
that is, it is uppercase in code font and its name is followed by `()` to indicate that it is a function-like macro. Object-like macros appear without the trailing `()`.
@@ -133,7 +118,7 @@
The __Boost_Ratio__ library provides:
-* A class template, __ratio__, for specifying compile time rational constants such as 1/3 of a nanosecond or the number of inches per meter. __ratio__ represents a compile time ratio of compile time constants with support for compile time arithmetic with overflow and division by zero protection
+* A class template, __ratio, for specifying compile time rational constants such as 1/3 of a nanosecond or the number of inches per meter. __ratio represents a compile time ratio of compile time constants with support for compile time arithmetic with overflow and division by zero protection
* It provides a textual representation of `boost::ratio<N, D>` in the form of a `std::basic_string` which can be useful for I/O.
@@ -182,7 +167,7 @@
[heading Requirements]
[/===================]
-__Boost_Ratio__ depends on some Boost libraries. For these specific parts you must use either Boost version 1.39.0 or the version in SVN trunk (even if older versions should works also).
+__Boost_Ratio__ depends on some Boost libraries. For these specific parts you must use either Boost version 1.39.0 or later (even if older versions should works also).
In particular, __Boost_Ratio__ depends on:
@@ -285,29 +270,29 @@
[heading Ratio]
-__ratio__ is a general purpose utility inspired by Walter Brown allowing one to easily and safely compute rational values at compile time. The __ratio__ class catches all errors (such as divide by zero and overflow) at compile time. It is used in the duration and __time_point__ classes to efficiently create units of time. It can also be used in other "quantity" libraries or anywhere there is a rational constant which is known at compile time. The use of this utility can greatly reduce the chances of run time overflow because the __ratio__ (and any ratios resulting from __ratio__ arithmetic) are always reduced to lowest terms.
+__ratio is a general purpose utility inspired by Walter Brown allowing one to easily and safely compute rational values at compile time. The __ratio class catches all errors (such as divide by zero and overflow) at compile time. It is used in the duration and __time_point classes to efficiently create units of time. It can also be used in other "quantity" libraries or anywhere there is a rational constant which is known at compile time. The use of this utility can greatly reduce the chances of run time overflow because the __ratio (and any ratios resulting from __ratio arithmetic) are always reduced to lowest terms.
-__ratio__ is a template taking two intmax_ts, with the second defaulted to 1. In addition to copy constructors and assignment, it only has two public members, both of which are static const intmax_t. One is the numerator of the __ratio__ and the other is the denominator. The __ratio__ is always normalized such that it is expressed in lowest terms, and the denominator is always positive. When the numerator is 0, the denominator is always 1.
+__ratio is a template taking two intmax_ts, with the second defaulted to 1. In addition to copy constructors and assignment, it only has two public members, both of which are static const intmax_t. One is the numerator of the __ratio and the other is the denominator. The __ratio is always normalized such that it is expressed in lowest terms, and the denominator is always positive. When the numerator is 0, the denominator is always 1.
[*Example:]
- typedef __ratio__<5, 3> five_thirds;
+ typedef __ratio<5, 3> five_thirds;
// five_thirds::num == 5, five_thirds::den == 3
- typedef __ratio__<25, 15> also_five_thirds;
+ typedef __ratio<25, 15> also_five_thirds;
// also_five_thirds::num == 5, also_five_thirds::den == 3
typedef ratio_divide<five_thirds, also_five_thirds>::type one;
// one::num == 1, one::den == 1
-This facility also includes convenience typedefs for the SI prefixes __atto through __exa corresponding to their internationally recognized definitions (in terms of __ratio__). This is a tremendous syntactic convenience. It will prevent errors in specifying constants as one no longer has to double count the number of zeros when trying to write millions or billions.
+This facility also includes convenience typedefs for the SI prefixes __atto through __exa corresponding to their internationally recognized definitions (in terms of __ratio). This is a tremendous syntactic convenience. It will prevent errors in specifying constants as one no longer has to double count the number of zeros when trying to write millions or billions.
[*Example:]
- typedef ratio_multiply<__ratio__<5>, giga>::type _5giga;
+ typedef ratio_multiply<__ratio<5>, giga>::type _5giga;
// _5giga::num == 5000000000, _5giga::den == 1
- typedef ratio_multiply<__ratio__<5>, nano>::type _5nano;
+ typedef ratio_multiply<__ratio<5>, nano>::type _5nano;
// _5nano::num == 1, _5nano::den == 200000000
[heading Ratio I/O]
@@ -403,15 +388,15 @@
Here's a small sampling of length units:
- typedef length<boost::__ratio__<1> > meter; // set meter as "unity"
+ typedef length<boost::__ratio<1> > meter; // set meter as "unity"
typedef length<boost::__centi> centimeter; // 1/100 meter
typedef length<boost::__kilo> kilometer; // 1000 meters
- typedef length<boost::__ratio__<254, 10000> > inch; // 254/10000 meters
+ typedef length<boost::__ratio<254, 10000> > inch; // 254/10000 meters
Note that since `length`'s template parameter is actually a generic ratio type, so we can use boost::ratio allowing for more complex length units:
- typedef length<boost::ratio_multiply<boost::__ratio__<12>, inch::__ratio__>::type> foot; // 12 inchs
- typedef length<boost::ratio_multiply<boost::__ratio__<5280>, foot::__ratio__>::type> mile; // 5280 feet
+ typedef length<boost::ratio_multiply<boost::__ratio<12>, inch::__ratio>::type> foot; // 12 inchs
+ typedef length<boost::ratio_multiply<boost::__ratio<5280>, foot::__ratio>::type> mile; // 5280 feet
Now we need a floating point-based definition of seconds:
@@ -439,7 +424,7 @@
};
template <>
- class quantity<boost::__ratio__<1>, boost::__ratio__<0> >
+ class quantity<boost::__ratio<1>, boost::__ratio<0> >
{
double q_;
public:
@@ -451,7 +436,7 @@
};
template <>
- class quantity<boost::__ratio__<0>, boost::__ratio__<1> >
+ class quantity<boost::__ratio<0>, boost::__ratio<1> >
{
double q_;
public:
@@ -463,7 +448,7 @@
};
template <>
- class quantity<boost::__ratio__<0>, boost::__ratio__<0> >
+ class quantity<boost::__ratio<0>, boost::__ratio<0> >
{
double q_;
public:
@@ -476,11 +461,11 @@
That allows us to create some useful SI-based unit types:
- typedef quantity<boost::__ratio__<0>, boost::__ratio__<0> > Scalar;
- typedef quantity<boost::__ratio__<1>, boost::__ratio__<0> > Time; // second
- typedef quantity<boost::__ratio__<0>, boost::__ratio__<1> > Distance; // meter
- typedef quantity<boost::__ratio__<-1>, boost::__ratio__<1> > Speed; // meter/second
- typedef quantity<boost::__ratio__<-2>, boost::__ratio__<1> > Acceleration; // meter/second^2
+ typedef quantity<boost::__ratio<0>, boost::__ratio<0> > Scalar;
+ typedef quantity<boost::__ratio<1>, boost::__ratio<0> > Time; // second
+ typedef quantity<boost::__ratio<0>, boost::__ratio<1> > Distance; // meter
+ typedef quantity<boost::__ratio<-1>, boost::__ratio<1> > Speed; // meter/second
+ typedef quantity<boost::__ratio<-2>, boost::__ratio<1> > Acceleration; // meter/second^2
To make quantity useful, we need to be able to do arithmetic:
@@ -541,10 +526,10 @@
int main()
{
- typedef boost::__ratio__<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
- typedef boost::__ratio__<3, BOOST_INTMAX_C(0x7FFFFFFFD)> R2;
- typedef User1::quantity<boost::ratio_subtract<boost::__ratio__<0>, boost::__ratio__<1> >::type,
- boost::ratio_subtract<boost::__ratio__<1>, boost::__ratio__<0> >::type > RR;
+ typedef boost::__ratio<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
+ typedef boost::__ratio<3, BOOST_INTMAX_C(0x7FFFFFFFD)> R2;
+ typedef User1::quantity<boost::ratio_subtract<boost::__ratio<0>, boost::__ratio<1> >::type,
+ boost::ratio_subtract<boost::__ratio<1>, boost::__ratio<0> >::type > RR;
typedef boost::ratio_subtract<R1, R2>::type RS;
std::cout << RS::num << '/' << RS::den << '\n';
@@ -553,7 +538,7 @@
std::cout << "* testUser1 *\n";
std::cout << "*************\n";
User1::Distance d( User1::mile(110) );
- User1::Time t( boost::chrono::__hours__(2) );
+ User1::Time t( boost::chrono::__hours(2) );
RR r=d / t;
//r.set(d.get() / t.get());
@@ -636,7 +621,7 @@
namespace boost {
- template <boost::intmax_t N, boost::intmax_t D = 1> class __ratio__;
+ template <boost::intmax_t N, boost::intmax_t D = 1> class __ratio;
// ratio arithmetic
template <class R1, class R2> struct __ratio_add;
@@ -677,7 +662,7 @@
[section:ratio_hpp Header `<boost/ratio.hpp>`]
[/===========================================]
-__ratio__ is a facility which is useful in specifying compile time rational constants. Compile time rational arithmetic is supported with protection against overflow and divide by zero. Such a facility is very handy when needing to efficiently represent 1/3 of a nanosecond, or specifying an inch in terms of meters (for example 254/10000 meters - which __ratio__ will reduce to 127/5000 meters).
+__ratio is a facility which is useful in specifying compile time rational constants. Compile time rational arithmetic is supported with protection against overflow and divide by zero. Such a facility is very handy when needing to efficiently represent 1/3 of a nanosecond, or specifying an inch in terms of meters (for example 254/10000 meters - which __ratio will reduce to 127/5000 meters).
// configuration macros
#define __BOOST_RATIO_USES_STATIC_ASSERT
@@ -729,7 +714,7 @@
ratio& operator=(const ratio<_N2, _D2>&) {return *this;}
};
-A diagnostic will be emitted if __ratio__ is instantiated with `D == 0`, or if the absolute value of `N` or `D` can not be represented. [*Note:] These rules ensure that infinite ratios are avoided and that for any negative input, there exists a representable value of its absolute value which is positive. In a two's complement representation, this excludes the most negative value.
+A diagnostic will be emitted if __ratio is instantiated with `D == 0`, or if the absolute value of `N` or `D` can not be represented. [*Note:] These rules ensure that infinite ratios are avoided and that for any negative input, there exists a representable value of its absolute value which is positive. In a two's complement representation, this excludes the most negative value.
The members num and den will be normalized values of the template arguments N and D computed as follows. Let `gcd` denote the greatest common divisor of `N`'s absolute value and of `D`'s absolute value. Then:
@@ -737,24 +722,24 @@
* `den` has the value `abs(D)/gcd`.
-The nested typedef `type` denotes the normalized form of this __ratio__ type. It should be
+The nested typedef `type` denotes the normalized form of this __ratio type. It should be
used when the normalized form of the template arguments are required, since the arguments are not necessarily normalized.
-Two __ratio__ classes `__ratio__<N1,D1>` and `__ratio__<N2,D2>` have the same normalized form if `__ratio__<N1,D1>::type` is the same type as `__ratio__<N2,D2>::type`
+Two __ratio classes `__ratio<N1,D1>` and `__ratio<N2,D2>` have the same normalized form if `__ratio<N1,D1>::type` is the same type as `__ratio<N2,D2>::type`
[section:ca Construction and Assignment]
template <intmax_t N2, intmax_t D2>
- ratio(const __ratio__<N2, D2>& r);
+ ratio(const __ratio<N2, D2>& r);
-[*Effects:] Constructs a __ratio__ object.
+[*Effects:] Constructs a __ratio object.
[*Remarks:] This constructor will not participate in overload resolution unless `r` has the same normalized form as `*this`.
template <intmax_t N2, intmax_t D2>
- __ratio__& operator=(const __ratio__<N2, D2>& r);
+ __ratio& operator=(const __ratio<N2, D2>& r);
-[*Effects:] Assigns a __ratio__ object.
+[*Effects:] Assigns a __ratio object.
[*Returns:] *this.
@@ -768,7 +753,7 @@
[section:ratio_arithmetic `ratio` Arithmetic]
-For each of the class templates in this section, each template parameter refers to a `ratio`. If the implementation is unable to form the indicated __ratio__ due to overflow, a diagnostic will be issued.
+For each of the class templates in this section, each template parameter refers to a `ratio`. If the implementation is unable to form the indicated __ratio due to overflow, a diagnostic will be issued.
[heading `ratio_add<>`]
@@ -776,7 +761,7 @@
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::den + R2::num * R1::den, R1::den * R2::den>::type`.
+The nested typedef `type` is a synonym for `__ratio<R1::num * R2::den + R2::num * R1::den, R1::den * R2::den>::type`.
[heading `ratio_subtract<>`]
@@ -784,7 +769,7 @@
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type`.
+The nested typedef `type` is a synonym for `__ratio<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type`.
[heading `ratio_multiply<>`]
@@ -792,7 +777,7 @@
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::num, R1::den * R2::den>::type`.
+The nested typedef `type` is a synonym for `__ratio<R1::num * R2::num, R1::den * R2::den>::type`.
[heading `ratio_divide<>`]
@@ -800,7 +785,7 @@
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::den, R2::num * R1::den>::type`.
+The nested typedef `type` is a synonym for `__ratio<R1::num * R2::den, R2::num * R1::den>::type`.
[endsect]
@@ -849,22 +834,22 @@
The [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes International System of Units] specifies twenty SI prefixes. __Boost_Ratio__ defines all except `yocto`, `zepto`, `zetta`, and `yotta`
// convenience SI typedefs
- typedef __ratio__<1LL, 1000000000000000000LL> atto;
- typedef __ratio__<1LL, 1000000000000000LL> femto;
- typedef __ratio__<1LL, 1000000000000LL> pico;
- typedef __ratio__<1LL, 1000000000LL> nano;
- typedef __ratio__<1LL, 1000000LL> micro;
- typedef __ratio__<1LL, 1000LL> milli;
- typedef __ratio__<1LL, 100LL> centi;
- typedef __ratio__<1LL, 10LL> deci;
- typedef __ratio__< 10LL, 1LL> deca;
- typedef __ratio__< 100LL, 1LL> hecto;
- typedef __ratio__< 1000LL, 1LL> kilo;
- typedef __ratio__< 1000000LL, 1LL> mega;
- typedef __ratio__< 1000000000LL, 1LL> giga;
- typedef __ratio__< 1000000000000LL, 1LL> tera;
- typedef __ratio__< 1000000000000000LL, 1LL> peta;
- typedef __ratio__<1000000000000000000LL, 1LL> exa;
+ typedef __ratio<1LL, 1000000000000000000LL> atto;
+ typedef __ratio<1LL, 1000000000000000LL> femto;
+ typedef __ratio<1LL, 1000000000000LL> pico;
+ typedef __ratio<1LL, 1000000000LL> nano;
+ typedef __ratio<1LL, 1000000LL> micro;
+ typedef __ratio<1LL, 1000LL> milli;
+ typedef __ratio<1LL, 100LL> centi;
+ typedef __ratio<1LL, 10LL> deci;
+ typedef __ratio< 10LL, 1LL> deca;
+ typedef __ratio< 100LL, 1LL> hecto;
+ typedef __ratio< 1000LL, 1LL> kilo;
+ typedef __ratio< 1000000LL, 1LL> mega;
+ typedef __ratio< 1000000000LL, 1LL> giga;
+ typedef __ratio< 1000000000000LL, 1LL> tera;
+ typedef __ratio< 1000000000000000LL, 1LL> peta;
+ typedef __ratio<1000000000000000000LL, 1LL> exa;
[endsect]
@@ -960,34 +945,21 @@
This simple example
- __ratio__<1,3> r1;
- __ratio__<3,9> r2;
+ __ratio<1,3> r1;
+ __ratio<3,9> r2;
r1 = r2; // (1)
fails to compile in (1). Other example
- __ratio__<1,3> r1;
- ratio_subtract<__ratio__<2,3>,__ratio__<1,3> > r2=r1; // (2)
+ __ratio<1,3> r1;
+ __ratio_subtract<__ratio<2,3>,__ratio<1,3> > r2=r1; // (2)
-The type of ratio_subtract<__ratio__<2,3>,__ratio__<1,3> > could be __ratio__<3,9> so the compilation could fail in (2). It could also be __ratio__<1,3> and the compilation succeeds.
+The type of `__ratio_subtract<__ratio<2,3>,__ratio<1,3> >` could be `__ratio<3,9>` so the compilation could fail in (2). It could also be __ratio<1,3> and the compilation succeeds.
[heading Why ratio needs the nested normalizer typedef type]
The current resolution of issue LWG 1281 acknowledges the need for a nested type typedef, so Boost.Ratio is tracking the likely final version of std::ratio.
-[/
-In [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf [*N3000]] 20.4.2 and similar clauses
-
-['3 The nested typedef type shall be a synonym for __ratio__<T1, T2> where T1 has the value R1::num * R2::den - R2::num * R1::den and T2 has the value R1::den * R2::den.]
-
-The meaning of synonym let think that the result should be a normalized ratio equivalent to __ratio__<T1, T2>, but there is not an explicit definition of what synonym means in this context.
-
-If the CopyConstruction and Assignment ([[@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#12811281 [*LWG 1281]]) is not added we need a typedef for accessing the normalized ratio, and change 20.4.2 to return only this normalized result. In this case the user will need to
-
- __ratio__<1,3>::type r1;
- __ratio__<3,9>::type r2;
- r1 = r2; // compiles as both types are the same.
-]
[endsect]
[/======================================================]
@@ -1195,7 +1167,7 @@
The ratio.hpp source has been adapted from the experimental header `<ratio_io>` from Howard Hinnant.
-Thanks to Adrew Chinoff for his help polishing the documentation.
+Thanks to Adrew Chinnoff for his help polishing the documentation.
[endsect]
@@ -1275,7 +1247,7 @@
[heading For later releases]
-* Use constexpr on compiler providing it
+* Use constexpr on compilers providing it
* Use template aliases on compiler providing it
* Implement [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3135.html#3135 multiple arguments] ratio arithmetic.
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk