1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 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.79.1"> 7<link rel="home" href="../../index.html" title="Math Toolkit 2.12.0"> 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"> 11</head> 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> 20</tr></table> 21<hr> 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> 24</div> 25<div class="section"> 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> 30<p> 31 Function <code class="computeroutput"><span class="identifier">float_advance</span></code> advances 32 a floating-point number by a specified number of ULP. 33 </p> 34<h5> 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> 37 </h5> 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> 39</pre> 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> 41 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> 44 45<span class="special">}}</span> <span class="comment">// namespaces</span> 46</pre> 47<h5> 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 50 - float_advance</a> 51 </h5> 52<p> 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>. 54 </p> 55</div> 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-2019 Nikhar 59 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, 60 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan 61 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, 62 Daryle Walker and Xiaogang Zhang<p> 63 Distributed under the Boost Software License, Version 1.0. (See accompanying 64 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>) 65 </p> 66</div></td> 67</tr></table> 68<hr> 69<div class="spirit-nav"> 70<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> 71</div> 72</body> 73</html> 74