| <html lang="en"> |
| <head> |
| <title>signbit - Untitled</title> |
| <meta http-equiv="Content-Type" content="text/html"> |
| <meta name="description" content="Untitled"> |
| <meta name="generator" content="makeinfo 4.13"> |
| <link title="Top" rel="start" href="index.html#Top"> |
| <link rel="up" href="Math.html#Math" title="Math"> |
| <link rel="prev" href="scalbn.html#scalbn" title="scalbn"> |
| <link rel="next" href="sin.html#sin" title="sin"> |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <style type="text/css"><!-- |
| pre.display { font-family:inherit } |
| pre.format { font-family:inherit } |
| pre.smalldisplay { font-family:inherit; font-size:smaller } |
| pre.smallformat { font-family:inherit; font-size:smaller } |
| pre.smallexample { font-size:smaller } |
| pre.smalllisp { font-size:smaller } |
| span.sc { font-variant:small-caps } |
| span.roman { font-family:serif; font-weight:normal; } |
| span.sansserif { font-family:sans-serif; font-weight:normal; } |
| --></style> |
| </head> |
| <body> |
| <div class="node"> |
| <a name="signbit"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="sin.html#sin">sin</a>, |
| Previous: <a rel="previous" accesskey="p" href="scalbn.html#scalbn">scalbn</a>, |
| Up: <a rel="up" accesskey="u" href="Math.html#Math">Math</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">1.51 <code>signbit</code>–Does floating-point number have negative sign?</h3> |
| |
| <p><a name="index-signbit-139"></a><strong>Synopsis</strong> |
| <pre class="example"> #include <math.h> |
| int signbit(real-floating <var>x</var>); |
| |
| </pre> |
| <p><strong>Description</strong><br> |
| The <code>signbit</code> macro determines whether the sign of its argument value is |
| negative. The macro reports the sign of all values, including infinities, |
| zeros, and NaNs. If zero is unsigned, it is treated as positive. As shown in |
| the synopsis, the argument is "real-floating," meaning that any of the real |
| floating-point types (float, double, etc.) may be given to it. |
| |
| <p>Note that because of the possibilities of signed 0 and NaNs, the expression |
| "<var>x</var> < 0.0" does not give the same result as <code>signbit</code> in all cases. |
| |
| <p><br> |
| <strong>Returns</strong><br> |
| The <code>signbit</code> macro returns a nonzero value if and only if the sign of its |
| argument value is negative. |
| |
| <p><br> |
| <strong>Portability</strong><br> |
| C99, POSIX. |
| |
| <p><br> |
| |
| </body></html> |
| |