Файловый менеджер - Редактировать - /usr/share/doc/imath-devel/html/classes/half.html
�азад
<!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>The half Class — Imath Documentation</title> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/bizstyle.css" type="text/css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script src="../_static/bizstyle.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="half Limits" href="../half_limits.html" /> <link rel="prev" title="Install Options" href="../install.html" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" /> <!--[if lt IE 9]> <script src="_static/css3-mediaqueries.js"></script> <![endif]--> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../half_limits.html" title="half Limits" accesskey="N">next</a> |</li> <li class="right" > <a href="../install.html" title="Install Options" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Imath</a> »</li> <li class="nav-item nav-item-this"><a href="">The half Class</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="the-half-class"> <h1>The half Class<a class="headerlink" href="#the-half-class" title="Permalink to this headline">¶</a></h1> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#include <Imath/half.h></span> </pre></div> </div> <p><code class="docutils literal notranslate"><span class="pre">half</span></code> is a 16-bit floating point number. See <a href="#id1"><span class="problematic" id="id2">`The half Type`_</span></a> for an explanation of the representation.</p> <p>Also, see <a href="#id3"><span class="problematic" id="id4">`C-language half Conversion`_</span></a> for C-language support for conversion between <code class="docutils literal notranslate"><span class="pre">half</span></code> and <code class="docutils literal notranslate"><span class="pre">float</span></code>.</p> <p>Example:</p> <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><Imath/half.h></span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf"><math.h></span><span class="cp"></span> <span class="kt">void</span> <span class="nf">half_example</span><span class="p">()</span> <span class="p">{</span> <span class="n">half</span> <span class="n">a</span> <span class="p">(</span><span class="mf">3.5</span><span class="p">);</span> <span class="kt">float</span> <span class="n">b</span> <span class="p">(</span><span class="n">a</span> <span class="o">+</span> <span class="n">sqrt</span> <span class="p">(</span><span class="n">a</span><span class="p">));</span> <span class="n">a</span> <span class="o">+=</span> <span class="n">b</span><span class="p">;</span> <span class="n">b</span> <span class="o">+=</span> <span class="n">a</span><span class="p">;</span> <span class="n">b</span> <span class="o">=</span> <span class="n">a</span> <span class="o">+</span> <span class="mi">7</span><span class="p">;</span> <span class="p">}</span> </pre></div> </div> <dl class="cpp class"> <dt id="_CPPv4N5Imath4halfE"> <span id="_CPPv3N5Imath4halfE"></span><span id="_CPPv2N5Imath4halfE"></span><span id="Imath::half"></span><span class="target" id="class_imath_1_1half"></span><em class="property">class </em><code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">half</code><a class="headerlink" href="#_CPPv4N5Imath4halfE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>class half 16-bit floating point number </p> <p>Type half can represent positive and negative numbers whose magnitude is between roughly 6.1e-5 and 6.5e+4 with a relative error of 9.8e-4; numbers smaller than 6.1e-5 can be represented with an absolute error of 6.0e-8. All integers from -2048 to +2048 can be represented exactly.</p> <p>Type half behaves (almost) like the built-in C++ floating point types. In arithmetic expressions, half, float and double can be mixed freely. Here are a few examples: <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">half</span> <span class="n">a</span> <span class="p">(</span><span class="mf">3.5</span><span class="p">);</span> <span class="nb">float</span> <span class="n">b</span> <span class="p">(</span><span class="n">a</span> <span class="o">+</span> <span class="n">sqrt</span> <span class="p">(</span><span class="n">a</span><span class="p">));</span> <span class="n">a</span> <span class="o">+=</span> <span class="n">b</span><span class="p">;</span> <span class="n">b</span> <span class="o">+=</span> <span class="n">a</span><span class="p">;</span> <span class="n">b</span> <span class="o">=</span> <span class="n">a</span> <span class="o">+</span> <span class="mi">7</span><span class="p">;</span> </pre></div> </div> Conversions from half to float are lossless; all half numbers are exactly representable as floats.</p> <p>Conversions from float to half may not preserve a float’s value exactly. If a float is not representable as a half, then the float value is rounded to the nearest representable half. If a float value is exactly in the middle between the two closest representable half values, then the float value is rounded to the closest half whose least significant bit is zero.</p> <p>Overflows during float-to-half conversions cause arithmetic exceptions. An overflow occurs when the float value to be converted is too large to be represented as a half, or if the float value is an infinity or a NAN.</p> <p>The implementation of type half makes the following assumptions about the implementation of the built-in C++ types:</p> <p><ul class="simple"> <li><p>float is an IEEE 754 single-precision number</p></li> <li><p>sizeof (float) == 4</p></li> <li><p>sizeof (unsigned int) == sizeof (float)</p></li> <li><p>alignof (unsigned int) == alignof (float)</p></li> <li><p>sizeof (uint16_t) == 2 </p></li> </ul> </p> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Constructors</p> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4halfEv"> <span id="_CPPv3N5Imath4half4halfEv"></span><span id="_CPPv2N5Imath4half4halfEv"></span><span id="Imath::half::half"></span><span class="target" id="class_imath_1_1half_1a769b5b4e3954d9216495ed48b849cea0"></span><code class="sig-name descname">half</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">noexcept</em> = default<a class="headerlink" href="#_CPPv4N5Imath4half4halfEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Default construction provides no initialization (hence it is not constexpr). </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4halfEf"> <span id="_CPPv3N5Imath4half4halfEf"></span><span id="_CPPv2N5Imath4half4halfEf"></span><span id="Imath::half::half__float"></span><span class="target" id="class_imath_1_1half_1af9cb626b9e569a7dfeffb6faf445bc0a"></span><em class="property">inline</em> <code class="sig-name descname">half</code><span class="sig-paren">(</span>float <em>f</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half4halfEf" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Construct from float. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4halfE11FromBitsTag8uint16_t"> <span id="_CPPv3N5Imath4half4halfE11FromBitsTag8uint16_t"></span><span id="_CPPv2N5Imath4half4halfE11FromBitsTag8uint16_t"></span><span id="Imath::half::half__FromBitsTag.uint16_tCE"></span><span class="target" id="class_imath_1_1half_1adc1c5c58965cbbf817ebe9700a406c38"></span><em class="property">inline</em> <em class="property">constexpr</em> <code class="sig-name descname">half</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4half11FromBitsTagE" title="Imath::half::FromBitsTag">FromBitsTag</a>, uint16_t <em>bits</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half4halfE11FromBitsTag8uint16_t" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Construct from bit-vector. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4halfERK4half"> <span id="_CPPv3N5Imath4half4halfERK4half"></span><span id="_CPPv2N5Imath4half4halfERK4half"></span><span id="Imath::half::half__halfCRCE"></span><span class="target" id="class_imath_1_1half_1a892319e74c727ff710dd81baa25575dd"></span><em class="property">constexpr</em> <code class="sig-name descname">half</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv4N5Imath4half4halfERK4half" title="Imath::half::half">half</a>&<span class="sig-paren">)</span> <em class="property">noexcept</em> = default<a class="headerlink" href="#_CPPv4N5Imath4half4halfERK4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Copy constructor. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4halfERR4half"> <span id="_CPPv3N5Imath4half4halfERR4half"></span><span id="_CPPv2N5Imath4half4halfERR4half"></span><span id="Imath::half::half__halfRRCE"></span><span class="target" id="class_imath_1_1half_1a66966a5dfcdf258743fff56c1027c9b0"></span><em class="property">constexpr</em> <code class="sig-name descname">half</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4half4halfERR4half" title="Imath::half::half">half</a>&&<span class="sig-paren">)</span> <em class="property">noexcept</em> = default<a class="headerlink" href="#_CPPv4N5Imath4half4halfERR4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Move constructor. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfD0Ev"> <span id="_CPPv3N5Imath4halfD0Ev"></span><span id="_CPPv2N5Imath4halfD0Ev"></span><span id="Imath::half::~half"></span><span class="target" id="class_imath_1_1half_1a91f0208706a3e0c2a7da3e768b21edff"></span><code class="sig-name descname">~half</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">noexcept</em> = default<a class="headerlink" href="#_CPPv4N5Imath4halfD0Ev" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Destructor. </p> </dd></dl> </div> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Basic Algebra</p> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4halfmiEv"> <span id="_CPPv3NK5Imath4halfmiEv"></span><span id="_CPPv2NK5Imath4halfmiEv"></span><span id="Imath::half::sub-operatorCCE"></span><span class="target" id="class_imath_1_1half_1af7d47208bbe953a33e6917130783f04f"></span><em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <code class="sig-name descname">operator-</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4halfmiEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Unary minus. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfaSERK4half"> <span id="_CPPv3N5Imath4halfaSERK4half"></span><span id="_CPPv2N5Imath4halfaSERK4half"></span><span id="Imath::half::assign-operator__halfCR"></span><span class="target" id="class_imath_1_1half_1a5484f7c4c50afaf4c8374864d11738c4"></span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator=</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<em>h</em><span class="sig-paren">)</span> <em class="property">noexcept</em> = default<a class="headerlink" href="#_CPPv4N5Imath4halfaSERK4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Assignment. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfaSERR4half"> <span id="_CPPv3N5Imath4halfaSERR4half"></span><span id="_CPPv2N5Imath4halfaSERR4half"></span><span id="Imath::half::assign-operator__halfRR"></span><span class="target" id="class_imath_1_1half_1a61c587f5095cd74e8a39de2a68b595cb"></span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator=</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &&<em>h</em><span class="sig-paren">)</span> <em class="property">noexcept</em> = default<a class="headerlink" href="#_CPPv4N5Imath4halfaSERR4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Move assignment. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfaSEf"> <span id="_CPPv3N5Imath4halfaSEf"></span><span id="_CPPv2N5Imath4halfaSEf"></span><span id="Imath::half::assign-operator__float"></span><span class="target" id="class_imath_1_1half_1ad100c942419cf360ed725a6414576a01"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator=</code><span class="sig-paren">(</span>float <em>f</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfaSEf" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Assignment from float. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfpLE4half"> <span id="_CPPv3N5Imath4halfpLE4half"></span><span id="_CPPv2N5Imath4halfpLE4half"></span><span id="Imath::half::add-assign-operator__half"></span><span class="target" id="class_imath_1_1half_1a1b46ffa1a7028d19ca5e943c3721c7e6"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator+=</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <em>h</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfpLE4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Addition assignment. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfpLEf"> <span id="_CPPv3N5Imath4halfpLEf"></span><span id="_CPPv2N5Imath4halfpLEf"></span><span id="Imath::half::add-assign-operator__float"></span><span class="target" id="class_imath_1_1half_1a8363c932469de9c25b033766c34de82d"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator+=</code><span class="sig-paren">(</span>float <em>f</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfpLEf" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Addition assignment from float. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfmIE4half"> <span id="_CPPv3N5Imath4halfmIE4half"></span><span id="_CPPv2N5Imath4halfmIE4half"></span><span id="Imath::half::sub-assign-operator__half"></span><span class="target" id="class_imath_1_1half_1a213f6e579be8864e0f8262d7a2ea56fb"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator-=</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <em>h</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfmIE4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Subtraction assignment. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfmIEf"> <span id="_CPPv3N5Imath4halfmIEf"></span><span id="_CPPv2N5Imath4halfmIEf"></span><span id="Imath::half::sub-assign-operator__float"></span><span class="target" id="class_imath_1_1half_1af7abd4b77fe5875192211c32a866a659"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator-=</code><span class="sig-paren">(</span>float <em>f</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfmIEf" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Subtraction assignment from float. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfmLE4half"> <span id="_CPPv3N5Imath4halfmLE4half"></span><span id="_CPPv2N5Imath4halfmLE4half"></span><span id="Imath::half::mul-assign-operator__half"></span><span class="target" id="class_imath_1_1half_1a844f17a4ff8fa6d6a771ef80f8efaf74"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator*=</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <em>h</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfmLE4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Multiplication assignment. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfmLEf"> <span id="_CPPv3N5Imath4halfmLEf"></span><span id="_CPPv2N5Imath4halfmLEf"></span><span id="Imath::half::mul-assign-operator__float"></span><span class="target" id="class_imath_1_1half_1a7861b856634401a10a14c0973dff4a65"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator*=</code><span class="sig-paren">(</span>float <em>f</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfmLEf" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Multiplication assignment from float. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfdVE4half"> <span id="_CPPv3N5Imath4halfdVE4half"></span><span id="_CPPv2N5Imath4halfdVE4half"></span><span id="Imath::half::div-assign-operator__half"></span><span class="target" id="class_imath_1_1half_1ac440aabd8100c193770397b81f3b23d8"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator/=</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <em>h</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfdVE4half" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Division assignment. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4halfdVEf"> <span id="_CPPv3N5Imath4halfdVEf"></span><span id="_CPPv2N5Imath4halfdVEf"></span><span id="Imath::half::div-assign-operator__float"></span><span class="target" id="class_imath_1_1half_1a21e23b7df6f7223ffb331dbe56d51fe3"></span><em class="property">inline</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> &<code class="sig-name descname">operator/=</code><span class="sig-paren">(</span>float <em>f</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4halfdVEf" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Division assignment from float. </p> </dd></dl> </div> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Classification</p> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half8isFiniteEv"> <span id="_CPPv3NK5Imath4half8isFiniteEv"></span><span id="_CPPv2NK5Imath4half8isFiniteEv"></span><span id="Imath::half::isFiniteCCE"></span><span class="target" id="class_imath_1_1half_1ac0418055534c96657371271c330952a0"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isFinite</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half8isFiniteEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if a normalized number, a denormalized number, or zero. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half12isNormalizedEv"> <span id="_CPPv3NK5Imath4half12isNormalizedEv"></span><span id="_CPPv2NK5Imath4half12isNormalizedEv"></span><span id="Imath::half::isNormalizedCCE"></span><span class="target" id="class_imath_1_1half_1a15f8c66e2f79b81bc9232bba8a8bd993"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isNormalized</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half12isNormalizedEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if a normalized number. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half14isDenormalizedEv"> <span id="_CPPv3NK5Imath4half14isDenormalizedEv"></span><span id="_CPPv2NK5Imath4half14isDenormalizedEv"></span><span id="Imath::half::isDenormalizedCCE"></span><span class="target" id="class_imath_1_1half_1a67da50bd2730113560d3dfc74e110c70"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isDenormalized</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half14isDenormalizedEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if a denormalized number. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half6isZeroEv"> <span id="_CPPv3NK5Imath4half6isZeroEv"></span><span id="_CPPv2NK5Imath4half6isZeroEv"></span><span id="Imath::half::isZeroCCE"></span><span class="target" id="class_imath_1_1half_1a66fb948779bd7a00a8eaeba951f052f9"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isZero</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half6isZeroEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if zero. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half5isNanEv"> <span id="_CPPv3NK5Imath4half5isNanEv"></span><span id="_CPPv2NK5Imath4half5isNanEv"></span><span id="Imath::half::isNanCCE"></span><span class="target" id="class_imath_1_1half_1aa2159e4d76bccb0f4250105d1a7df547"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isNan</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half5isNanEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if NAN. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half10isInfinityEv"> <span id="_CPPv3NK5Imath4half10isInfinityEv"></span><span id="_CPPv2NK5Imath4half10isInfinityEv"></span><span id="Imath::half::isInfinityCCE"></span><span class="target" id="class_imath_1_1half_1a6d640ffd1289f5e610b211e1cc0589b8"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isInfinity</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half10isInfinityEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if a positive or a negative infinity. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half10isNegativeEv"> <span id="_CPPv3NK5Imath4half10isNegativeEv"></span><span id="_CPPv2NK5Imath4half10isNegativeEv"></span><span id="Imath::half::isNegativeCCE"></span><span class="target" id="class_imath_1_1half_1a50f0bfc24c1f8a2816abcb6ab5ce195c"></span><em class="property">inline</em> <em class="property">constexpr</em> bool <code class="sig-name descname">isNegative</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half10isNegativeEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return true if the sign bit is set (negative) </p> </dd></dl> </div> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Access to the internal representation</p> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half4bitsEv"> <span id="_CPPv3NK5Imath4half4bitsEv"></span><span id="_CPPv2NK5Imath4half4bitsEv"></span><span id="Imath::half::bitsCCE"></span><span class="target" id="class_imath_1_1half_1a790ef7fe5ef85456776989807a0257f6"></span><em class="property">inline</em> <em class="property">constexpr</em> uint16_t <code class="sig-name descname">bits</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half4bitsEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return the bit pattern. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half7setBitsE8uint16_t"> <span id="_CPPv3N5Imath4half7setBitsE8uint16_t"></span><span id="_CPPv2N5Imath4half7setBitsE8uint16_t"></span><span id="Imath::half::setBits__uint16_tCE"></span><span class="target" id="class_imath_1_1half_1aa024abd5f8c10135db6a804e1dd00edb"></span><em class="property">inline</em> <em class="property">constexpr</em> void <code class="sig-name descname">setBits</code><span class="sig-paren">(</span>uint16_t <em>bits</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half7setBitsE8uint16_t" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Set the bit pattern. </p> </dd></dl> </div> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Special values</p> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half6posInfEv"> <span id="_CPPv3N5Imath4half6posInfEv"></span><span id="_CPPv2N5Imath4half6posInfEv"></span><span id="Imath::half::posInfCE"></span><span class="target" id="class_imath_1_1half_1af283712b01875d87b8a2466c8c37750a"></span><em class="property">static</em> <em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <code class="sig-name descname">posInf</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half6posInfEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return +infinity. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half6negInfEv"> <span id="_CPPv3N5Imath4half6negInfEv"></span><span id="_CPPv2N5Imath4half6negInfEv"></span><span id="Imath::half::negInfCE"></span><span class="target" id="class_imath_1_1half_1a3d7424ee63d44cbc9c1bc112ce5e9e04"></span><em class="property">static</em> <em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <code class="sig-name descname">negInf</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half6negInfEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return -infinity. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4qNanEv"> <span id="_CPPv3N5Imath4half4qNanEv"></span><span id="_CPPv2N5Imath4half4qNanEv"></span><span id="Imath::half::qNanCE"></span><span class="target" id="class_imath_1_1half_1ad9bf2512043e462045f2fb6b66773dbc"></span><em class="property">static</em> <em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <code class="sig-name descname">qNan</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half4qNanEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Returns a NAN with the bit pattern 0111111111111111. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath4half4sNanEv"> <span id="_CPPv3N5Imath4half4sNanEv"></span><span id="_CPPv2N5Imath4half4sNanEv"></span><span id="Imath::half::sNanCE"></span><span class="target" id="class_imath_1_1half_1ad324399e86287335047ca19423889320"></span><em class="property">static</em> <em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <code class="sig-name descname">sNan</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4N5Imath4half4sNanEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return a NAN with the bit pattern 0111110111111111. </p> </dd></dl> </div> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Public Types</p> <dl class="cpp enum"> <dt id="_CPPv4N5Imath4half11FromBitsTagE"> <span id="_CPPv3N5Imath4half11FromBitsTagE"></span><span id="_CPPv2N5Imath4half11FromBitsTagE"></span><span class="target" id="class_imath_1_1half_1a19b8ffbb835f6c45cc47bb12dd69b22b"></span><em class="property">enum </em><code class="sig-name descname">FromBitsTag</code><a class="headerlink" href="#_CPPv4N5Imath4half11FromBitsTagE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>A special tag that lets us initialize a half from the raw bits. </p> <p><em>Values:</em></p> <dl class="cpp enumerator"> <dt id="_CPPv4N5Imath4half11FromBitsTag8FromBitsE"> <span id="_CPPv3N5Imath4half11FromBitsTag8FromBitsE"></span><span id="_CPPv2N5Imath4half11FromBitsTag8FromBitsE"></span><span class="target" id="class_imath_1_1half_1a19b8ffbb835f6c45cc47bb12dd69b22ba72add08d614094c8b5baa3173bb23c8f"></span><em class="property">enumerator </em><code class="sig-name descname">FromBits</code><a class="headerlink" href="#_CPPv4N5Imath4half11FromBitsTag8FromBitsE" title="Permalink to this definition">¶</a><br /></dt> <dd></dd></dl> </dd></dl> <dl class="cpp type"> <dt id="_CPPv4N5Imath4half3uifE"> <span id="_CPPv3N5Imath4half3uifE"></span><span id="_CPPv2N5Imath4half3uifE"></span><span class="target" id="class_imath_1_1half_1a05db8588f1bbefb24f23a171a027938d"></span><em class="property">using </em><code class="sig-name descname">uif</code> = imath_half_uif<a class="headerlink" href="#_CPPv4N5Imath4half3uifE" title="Permalink to this definition">¶</a><br /></dt> <dd></dd></dl> </div> <div class="breathe-sectiondef docutils container"> <p class="breathe-sectiondef-title rubric">Public Functions</p> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4halfcvfEv"> <span id="_CPPv3NK5Imath4halfcvfEv"></span><span id="_CPPv2NK5Imath4halfcvfEv"></span><span id="Imath::half::castto-float-operatorC"></span><span class="target" id="class_imath_1_1half_1a852743bef54607602b1d4c5140c87c56"></span><em class="property">inline</em> <code class="sig-name descname">operator float</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4halfcvfEv" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Conversion to float. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4NK5Imath4half5roundEj"> <span id="_CPPv3NK5Imath4half5roundEj"></span><span id="_CPPv2NK5Imath4half5roundEj"></span><span id="Imath::half::round__unsigned-iCCE"></span><span class="target" id="class_imath_1_1half_1ab83d41801531c30bd0317b0931dfc895"></span><em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <code class="sig-name descname">round</code><span class="sig-paren">(</span>unsigned int <em>n</em><span class="sig-paren">)</span> <em class="property">const</em> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4NK5Imath4half5roundEj" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Round to n-bit precision (n should be between 0 and 10). </p> <p>After rounding, the significand’s 10-n least significant bits will be zero. </p> </dd></dl> </div> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4lsRNSt7ostreamEN5Imath4halfE"> <span id="_CPPv3lsRNSt7ostreamEN5Imath4halfE"></span><span id="_CPPv2lsRNSt7ostreamEN5Imath4halfE"></span><span id="lshift-operator__osR.Imath::half"></span><span class="target" id="half_8h_1ae9a73ca860ce07e000c6f233e94be623"></span>std::ostream &<code class="sig-name descname">operator<<</code><span class="sig-paren">(</span>std::ostream &<em>os</em>, Imath::<a class="reference internal" href="#_CPPv4N5Imath4halfE" title="Imath::half">half</a> <em>h</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4lsRNSt7ostreamEN5Imath4halfE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Output h to os, formatted as a float. </p> </dd></dl> <div class="admonition warning"> <p class="admonition-title">Warning</p> <p>doxygenfunction: Unable to resolve function “operator>>” with arguments (std::ostream&, Imath::half&) in doxygen xml output for project “Imath” from directory: doxyxml/. Potential matches: </p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> <span class="n">std</span><span class="p">::</span><span class="n">istream</span> <span class="o">&</span><span class="n">operator</span><span class="o">>></span><span class="p">(</span><span class="n">std</span><span class="p">::</span><span class="n">istream</span> <span class="o">&</span><span class="ow">is</span><span class="p">,</span> <span class="n">Imath</span><span class="p">::</span><span class="n">half</span> <span class="o">&</span><span class="n">h</span><span class="p">)</span> </pre></div> </div> </div> </div> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../index.html"> <img class="logo" src="../_static/imath-logo-blue.png" alt="Logo"/> </a></p> <h4>Previous topic</h4> <p class="topless"><a href="../install.html" title="previous chapter">Install Options</a></p> <h4>Next topic</h4> <p class="topless"><a href="../half_limits.html" title="next chapter">half Limits</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/classes/half.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../half_limits.html" title="half Limits" >next</a> |</li> <li class="right" > <a href="../install.html" title="Install Options" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Imath</a> »</li> <li class="nav-item nav-item-this"><a href="">The half Class</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2021, Contributors to the OpenEXR Project. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3. </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка