blob: 759a252da5b812fab3cf24c21e3b37b0b93c56ab [file]
<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:&nbsp;<a rel="next" accesskey="n" href="pow.html#pow">pow</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="nearbyint.html#nearbyint">nearbyint</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Math.html#Math">Math</a>
<hr>
</div>
<h3 class="section">1.44 <code>nextafter</code>, <code>nextafterf</code>&mdash;get next number</h3>
<p><a name="index-nextafter-123"></a><a name="index-nextafterf-124"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;math.h&gt;
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>