summaryrefslogtreecommitdiff
path: root/devdocs/c/types%2Flimits%2Fflt_rounds.html
blob: 0386877fb6d4aeecf883de386f863a3ce395a070 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
    <h1 id="firstHeading" class="firstHeading">FLT_ROUNDS</h1>            <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;float.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl"> <td class="t-dcl-nopad"> <pre data-language="c">#define FLT_ROUNDS /* implementation defined */</pre>
</td> <td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr>  </table> <p>Returns the current rounding direction of floating-point arithmetic operations.</p>
<table class="t-dsc-begin"> <tr class="t-dsc-hitem"> <th> Value </th> <th> Explanation </th>
</tr> <tr class="t-dsc"> <td> <code>-1</code> </td> <td> the default rounding direction is not known </td>
</tr> <tr class="t-dsc"> <td> <code>0</code> </td> <td> toward zero; same meaning as <code><a href="../../numeric/fenv/fe_round" title="c/numeric/fenv/FE round">FE_TOWARDZERO</a></code> </td>
</tr> <tr class="t-dsc"> <td> <code>1</code> </td> <td> to nearest; same meaning as <code><a href="../../numeric/fenv/fe_round" title="c/numeric/fenv/FE round">FE_TONEAREST</a></code> </td>
</tr> <tr class="t-dsc"> <td> <code>2</code> </td> <td> towards positive infinity; same meaning as <code><a href="../../numeric/fenv/fe_round" title="c/numeric/fenv/FE round">FE_UPWARD</a></code> </td>
</tr> <tr class="t-dsc"> <td> <code>3</code> </td> <td> towards negative infinity; same meaning as <code><a href="../../numeric/fenv/fe_round" title="c/numeric/fenv/FE round">FE_DOWNWARD</a></code> </td>
</tr> <tr class="t-dsc"> <td> other values </td> <td> implementation-defined behavior </td>
</tr> </table> <h3 id="Notes"> Notes</h3> <p>The rounding mode can be changed with <code><a href="../../numeric/fenv/feround" title="c/numeric/fenv/feround">fesetround</a></code> and <code>FLT_ROUNDS</code> reflects that change.</p>
<h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="../../numeric/fenv/feround" title="c/numeric/fenv/feround"> <span class="t-lines"><span>fegetround</span><span>fesetround</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> gets or sets rounding direction <br> <span class="t-mark">(function)</span>  </td>
</tr> <tr class="t-dsc"> <td> <div><a href="../../numeric/fenv/fe_round" title="c/numeric/fenv/FE round"> <span class="t-lines"><span>FE_DOWNWARD</span><span>FE_TONEAREST</span><span>FE_TOWARDZERO</span><span>FE_UPWARD</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> floating-point rounding direction <br> <span class="t-mark">(macro constant)</span>  </td>
</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/types/climits/FLT_ROUNDS" title="cpp/types/climits/FLT ROUNDS">C++ documentation</a></span> for <code>FLT_ROUNDS</code> </td>
</tr> </table>           <div class="_attribution">
  <p class="_attribution-p">
    &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
    <a href="https://en.cppreference.com/w/c/types/limits/FLT_ROUNDS" class="_attribution-link">https://en.cppreference.com/w/c/types/limits/FLT_ROUNDS</a>
  </p>
</div>