3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Advancing a floating-point Value by a Specific Representation Distance (ULP) float_advance
</title>
5 <link rel=
"stylesheet" href=
"../../math.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.77.1">
7 <link rel=
"home" href=
"../../index.html" title=
"Math Toolkit 2.5.1">
8 <link rel=
"up" href=
"../next_float.html" title=
"Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values">
9 <link rel=
"prev" href=
"float_distance.html" title=
"Calculating the Representation Distance Between Two floating-point Values (ULP) float_distance">
10 <link rel=
"next" href=
"ulp.html" title=
"Obtaining the Size of a Unit In the Last Place - ULP">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../../libs/libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"float_distance.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../next_float.html"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"ulp.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"math_toolkit.next_float.float_advance"></a><a class=
"link" href=
"float_advance.html" title=
"Advancing a floating-point Value by a Specific Representation Distance (ULP) float_advance">Advancing a floating-point
28 Value by a Specific Representation Distance (ULP) float_advance
</a>
29 </h3></div></div></div>
31 Function
<code class=
"computeroutput"><span class=
"identifier">float_advance
</span></code> advances
32 a floating-point number by a specified number of ULP.
35 <a name=
"math_toolkit.next_float.float_advance.h0"></a>
36 <span class=
"phrase"><a name=
"math_toolkit.next_float.float_advance.synopsis"></a></span><a class=
"link" href=
"float_advance.html#math_toolkit.next_float.float_advance.synopsis">Synopsis
</a>
38 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">math
</span><span class=
"special">/
</span><span class=
"identifier">special_functions
</span><span class=
"special">/
</span><span class=
"identifier">next
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span>
40 <pre class=
"programlisting"><span class=
"keyword">namespace
</span> <span class=
"identifier">boost
</span><span class=
"special">{
</span> <span class=
"keyword">namespace
</span> <span class=
"identifier">math
</span><span class=
"special">{
</span>
42 <span class=
"keyword">template
</span> <span class=
"special"><</span><span class=
"keyword">class
</span> <span class=
"identifier">FPT
</span><span class=
"special">></span>
43 <span class=
"identifier">FPT
</span> <span class=
"identifier">float_advance
</span><span class=
"special">(
</span><span class=
"identifier">FPT
</span> <span class=
"identifier">val
</span><span class=
"special">,
</span> <span class=
"keyword">int
</span> <span class=
"identifier">distance
</span><span class=
"special">);
</span>
45 <span class=
"special">}}
</span> <span class=
"comment">// namespaces
</span>
48 <a name=
"math_toolkit.next_float.float_advance.h1"></a>
49 <span class=
"phrase"><a name=
"math_toolkit.next_float.float_advance.description_float_advance"></a></span><a class=
"link" href=
"float_advance.html#math_toolkit.next_float.float_advance.description_float_advance">Description
53 Returns a floating-point number
<span class=
"emphasis"><em>r
</em></span> such that
<code class=
"computeroutput"><span class=
"identifier">float_distance
</span><span class=
"special">(
</span><span class=
"identifier">val
</span><span class=
"special">,
</span> <span class=
"identifier">r
</span><span class=
"special">)
</span> <span class=
"special">==
</span> <span class=
"identifier">distance
</span></code>.
56 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
57 <td align=
"left"></td>
58 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2006-
2010,
2012-
2014 Nikhar Agrawal,
59 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
60 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R
åde, Gautam Sewani,
61 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang
<p>
62 Distributed under the Boost Software License, Version
1.0. (See accompanying
63 file LICENSE_1_0.txt or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt" target=
"_top">http://www.boost.org/LICENSE_1_0.txt
</a>)
68 <div class=
"spirit-nav">
69 <a accesskey=
"p" href=
"float_distance.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../next_float.html"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"ulp.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>