summaryrefslogtreecommitdiff
path: root/devdocs/c/numeric%2Fmath%2Fisgreater.html
blob: 51bca1567aba50904a0f1483d3b9ddb08e9c40da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    <h1 id="firstHeading" class="firstHeading">isgreater</h1>            <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;math.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define isgreater(x, y) /* implementation defined */</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr>  </table> <p>Determines if the floating point number <code>x</code> is greater than the floating-point number (<code>y</code>), without setting floating-point exceptions.</p>
<h3 id="Parameters"> Parameters</h3> <table class="t-par-begin"> <tr class="t-par"> <td> x </td> <td> - </td> <td> floating point value </td>
</tr> <tr class="t-par"> <td> y </td> <td> - </td> <td> floating point value </td>
</tr>
</table> <h3 id="Return_value"> Return value</h3> <p>Nonzero integral value if <code>x &gt; y</code>, <code>​0​</code> otherwise.</p>
<h3 id="Notes"> Notes</h3> <p>The built-in <code>operator&gt;</code> for floating-point numbers may set <code><a href="../fenv/fe_exceptions" title="c/numeric/fenv/FE exceptions">FE_INVALID</a></code> if one or both of the arguments is NaN. This function is a "quiet" version of <code>operator&gt;</code>.</p>
<h3 id="Example"> Example</h3> <div class="t-example"> <div class="c source-c"><pre data-language="c">#include &lt;stdio.h&gt;
#include &lt;math.h&gt;
 
int main(void)
{
    printf("isgreater(2.0,1.0)      = %d\n", isgreater(2.0,1.0));
    printf("isgreater(1.0,2.0)      = %d\n", isgreater(1.0,2.0));
    printf("isgreater(INFINITY,1.0) = %d\n", isgreater(INFINITY,1.0));
    printf("isgreater(1.0,NAN)      = %d\n", isgreater(1.0,NAN));
 
    return 0;
}</pre></div> <p>Possible output:</p>
<div class="text source-text"><pre data-language="c">isgreater(2.0,1.0)      = 1
isgreater(1.0,2.0)      = 0
isgreater(INFINITY,1.0) = 1
isgreater(1.0,NAN)      = 0</pre></div> </div> <h3 id="References"> References</h3>  <ul>
<li> C17 standard (ISO/IEC 9899:2018): </li>
<ul>
<li> 7.12.14.1 The isgreater macro (p: 189) </li>
<li> F.10.11 Comparison macros (p: 386-387) </li>
</ul>
<li> C11 standard (ISO/IEC 9899:2011): </li>
<ul>
<li> 7.12.14.1 The isgreater macro (p: 259) </li>
<li> F.10.11 Comparison macros (p: 531) </li>
</ul>
<li> C99 standard (ISO/IEC 9899:1999): </li>
<ul><li> 7.12.14.1 The isgreater macro (p: 240) </li></ul>
</ul>             <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="isless" title="c/numeric/math/isless"> <span class="t-lines"><span>isless</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> checks if the first floating-point argument is less than the second <br> <span class="t-mark">(function macro)</span>  </td>
</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/numeric/math/isgreater" title="cpp/numeric/math/isgreater">C++ documentation</a></span> for <code>isgreater</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/numeric/math/isgreater" class="_attribution-link">https://en.cppreference.com/w/c/numeric/math/isgreater</a>
  </p>
</div>