| <html lang="en"> |
| <head> |
| <title>nextafter - 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="nearbyint.html#nearbyint" title="nearbyint"> |
| <link rel="next" href="pow.html#pow" title="pow"> |
| <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="nextafter"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="pow.html#pow">pow</a>, |
| Previous: <a rel="previous" accesskey="p" href="nearbyint.html#nearbyint">nearbyint</a>, |
| Up: <a rel="up" accesskey="u" href="Math.html#Math">Math</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">1.44 <code>nextafter</code>, <code>nextafterf</code>—get next number</h3> |
| |
| <p><a name="index-nextafter-123"></a><a name="index-nextafterf-124"></a><strong>Synopsis</strong> |
| <pre class="example"> #include <math.h> |
| double nextafter(double <var>val</var>, double <var>dir</var>); |
| float nextafterf(float <var>val</var>, float <var>dir</var>); |
| |
| </pre> |
| <p><strong>Description</strong><br> |
| <code>nextafter</code> returns the double-precision floating-point number |
| closest to <var>val</var> in the direction toward <var>dir</var>. <code>nextafterf</code> |
| performs the same operation in single precision. For example, |
| <code>nextafter(0.0,1.0)</code> returns the smallest positive number which is |
| representable in double precision. |
| |
| <p><br> |
| <strong>Returns</strong><br> |
| Returns the next closest number to <var>val</var> in the direction toward |
| <var>dir</var>. |
| |
| <p><br> |
| <strong>Portability</strong><br> |
| Neither <code>nextafter</code> nor <code>nextafterf</code> is required by ANSI C |
| or by the System V Interface Definition (Issue 2). |
| |
| <p><br> |
| |
| </body></html> |
| |