1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>cpp_dec_float</title> 5<link rel="stylesheet" href="../../multiprecision.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../index.html" title="Chapter 1. Boost.Multiprecision"> 8<link rel="up" href="../ref.html" title="Reference"> 9<link rel="prev" href="cpp_bin_float_ref.html" title="cpp_bin_float"> 10<link rel="next" href="internals.html" title="Internal Support Code"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="cpp_bin_float_ref.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="internals.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h3 class="title"> 27<a name="boost_multiprecision.ref.cpp_dec_ref"></a><a class="link" href="cpp_dec_ref.html" title="cpp_dec_float">cpp_dec_float</a> 28</h3></div></div></div> 29<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">multiprecision</span><span class="special">{</span> 30 31<span class="keyword">template</span> <span class="special"><</span><span class="keyword">unsigned</span> <span class="identifier">Digits10</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">ExponentType</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">int32_t</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">></span> 32<span class="keyword">class</span> <span class="identifier">cpp_dec_float</span><span class="special">;</span> 33 34<span class="keyword">typedef</span> <span class="identifier">number</span><span class="special"><</span><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="number">50</span><span class="special">></span> <span class="special">></span> <span class="identifier">cpp_dec_float_50</span><span class="special">;</span> 35<span class="keyword">typedef</span> <span class="identifier">number</span><span class="special"><</span><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="number">100</span><span class="special">></span> <span class="special">></span> <span class="identifier">cpp_dec_float_100</span><span class="special">;</span> 36 37<span class="special">}}</span> <span class="comment">// namespaces</span> 38</pre> 39<p> 40 Class template <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code> 41 fulfils all of the requirements for a <a class="link" href="backendconc.html" title="Backend Requirements">Backend</a> 42 type. Its members and non-member functions are deliberately not documented: 43 these are considered implementation details that are subject to change. 44 </p> 45<p> 46 The class takes three template parameters: 47 </p> 48<div class="variablelist"> 49<p class="title"><b></b></p> 50<dl class="variablelist"> 51<dt><span class="term">Digits10</span></dt> 52<dd><p> 53 The number of decimal digits precision the type should support. Note 54 that this type does not normally perform any dynamic memory allocation, 55 and as a result the <code class="computeroutput"><span class="identifier">Digits10</span></code> 56 template argument should not be set too high or the class's size will 57 grow unreasonably large. 58 </p></dd> 59<dt><span class="term">ExponentType</span></dt> 60<dd><p> 61 A signed integer type that represents the exponent of the number 62 </p></dd> 63<dt><span class="term">Allocator</span></dt> 64<dd><p> 65 The allocator used: defaults to type <code class="computeroutput"><span class="keyword">void</span></code>, 66 meaning all storage is within the class, and no dynamic allocation 67 is performed, but can be set to a standard library allocator if dynamic 68 allocation makes more sense. 69 </p></dd> 70</dl> 71</div> 72<p> 73 The type of <code class="computeroutput"><span class="identifier">number_category</span><span class="special"><</span><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="identifier">Args</span><span class="special">...></span> <span class="special">>::</span><span class="identifier">type</span></code> is <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">int_</span><span class="special"><</span><span class="identifier">number_kind_floating_point</span><span class="special">></span></code>. 74 </p> 75<p> 76 More information on this type can be found in the <a class="link" href="../tut/floats/cpp_dec_float.html" title="cpp_dec_float">tutorial</a>. 77 </p> 78</div> 79<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 80<td align="left"></td> 81<td align="right"><div class="copyright-footer">Copyright © 2002-2020 John 82 Maddock and Christopher Kormanyos<p> 83 Distributed under the Boost Software License, Version 1.0. (See accompanying 84 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 85 </p> 86</div></td> 87</tr></table> 88<hr> 89<div class="spirit-nav"> 90<a accesskey="p" href="cpp_bin_float_ref.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="internals.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 91</div> 92</body> 93</html> 94