mirror of
https://github.com/boostorg/mpl.git
synced 2026-01-27 17:32:20 +01:00
37 lines
2.1 KiB
HTML
37 lines
2.1 KiB
HTML
<!doctype html public "-//ietf//dtd html//en">
|
|
<html><head><title>boost::mpl::Rational Constant</title>
|
|
<link rel="stylesheet" href="./mpl_wiki.css">
|
|
</head><body bgcolor="white">
|
|
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Rational Constant</h1><h3>Description</h3>
|
|
<p>
|
|
A Rational Constant is a class representing the ration of two values of a built-in integral type (<code>bool</code>, <code>int</code>, <code>long</code>, etc.) in compile-time programs. A rational constant directly supports access to the numerator
|
|
and denominator. Other arithmetic operations are supported through the external metafunctions. A rational constant is always stored in simplified form.
|
|
<p>
|
|
<h3>Valid expressions</h3>
|
|
<p>
|
|
<table border="1">
|
|
<tr><th> Expression </th><th> Return type </th></tr>
|
|
<tr><td><code>typename n::integer_type</code></td><td>An <em>integral type</em> </td></tr>
|
|
<tr><td><code>typename n::type</code></td><td>A model of <a href="./Rational_Constant.html">Rational Constant</a> </td></tr>
|
|
<tr><td><code>typename n::numerator</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> representing the numerator </td></tr>
|
|
<tr><td><code>typename n::denominator</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> representing the denominator </td></tr>
|
|
<tr><td><code>n::value()</code></td><td>A run-time floating point approximation of <code>n::type</code> </td></tr>
|
|
</table>
|
|
<p>
|
|
<h3>Expression semantics</h3>
|
|
<p>
|
|
<table border="1">
|
|
<tr><th> Expression </th><th> Complexity </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
|
</table>
|
|
<p>
|
|
<h3>Models</h3>
|
|
<p>
|
|
<ul>
|
|
<li><code><a href="./Reference/rational_c.html">rational_c</a></code>
|
|
</ul>
|
|
<p>
|
|
<h3>See also</h3>
|
|
<p>
|
|
<a href="./Integral_Constant.html">Integral Constant</a>, <code><a href="./Reference/rational_c.html">rational_c</a></code>
|
|
<p><hr>
|
|
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited October 30, 2003 2:43 am</body></html> |