]>
Commit | Line | Data |
---|---|---|
1 | <html> | |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values</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="../utils.html" title="Chapter 2. Floating Point Utilities"> | |
9 | <link rel="prev" href="fp_facets/rationale.html" title="Design Rationale"> | |
10 | <link rel="next" href="next_float/nextafter.html" title="Finding the Next Representable Value in a Specific Direction (nextafter)"> | |
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="fp_facets/rationale.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utils.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="next_float/nextafter.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section"> | |
26 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | |
27 | <a name="math_toolkit.next_float"></a><a class="link" href="next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values">Floating-Point Representation | |
28 | Distance (ULP), and Finding Adjacent Floating-Point Values</a> | |
29 | </h2></div></div></div> | |
30 | <div class="toc"><dl> | |
31 | <dt><span class="section"><a href="next_float/nextafter.html">Finding the Next Representable | |
32 | Value in a Specific Direction (nextafter)</a></span></dt> | |
33 | <dt><span class="section"><a href="next_float/float_next.html">Finding the Next | |
34 | Greater Representable Value (float_next)</a></span></dt> | |
35 | <dt><span class="section"><a href="next_float/float_prior.html">Finding the Next | |
36 | Smaller Representable Value (float_prior)</a></span></dt> | |
37 | <dt><span class="section"><a href="next_float/float_distance.html">Calculating the | |
38 | Representation Distance Between Two floating-point Values (ULP) float_distance</a></span></dt> | |
39 | <dt><span class="section"><a href="next_float/float_advance.html">Advancing a floating-point | |
40 | Value by a Specific Representation Distance (ULP) float_advance</a></span></dt> | |
41 | <dt><span class="section"><a href="next_float/ulp.html">Obtaining the Size of a | |
42 | Unit In the Last Place - ULP</a></span></dt> | |
43 | </dl></div> | |
44 | <p> | |
45 | <a href="http://en.wikipedia.org/wiki/Unit_in_the_last_place" target="_top">Unit of Least | |
46 | Precision or Unit in the Last Place</a> is the gap between two different, | |
47 | but as close as possible, floating-point numbers. | |
48 | </p> | |
49 | <p> | |
50 | Most decimal values, for example 0.1, cannot be exactly represented as floating-point | |
51 | values, but will be stored as the <a href="http://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_rounding" target="_top">closest | |
52 | representable floating-point</a>. | |
53 | </p> | |
54 | <p> | |
55 | Functions are provided for finding adjacent greater and lesser floating-point | |
56 | values, and estimating the number of gaps between any two floating-point values. | |
57 | </p> | |
58 | <p> | |
59 | The floating-point type (FPT) must have has a fixed number of bits in the representation. | |
60 | The number of bits may set at runtime, but must be the same for all numbers. | |
61 | For example, <a href="http://shoup.net/ntl/doc/quad_float.txt" target="_top">NTL::quad_float</a> | |
62 | type (fixed 128-bit representation), <a href="http://shoup.net/ntl/doc/RR.txt" target="_top">NTL::RR</a> | |
63 | type (arbitrary but fixed decimal digits, default 150) or <a href="../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a> | |
64 | <a href="../../../../../libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html" target="_top">cpp_dec_float</a> | |
65 | and<a href="../../../../../libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_bin_float.html" target="_top">cpp_bin_float</a> | |
66 | are fixed at runtime, but <span class="bold"><strong>not</strong></span> a type that | |
67 | extends the representation to provide an exact representation for any number, | |
68 | for example <a href="http://keithbriggs.info/xrc.html" target="_top">XRC eXact Real in | |
69 | C</a>. | |
70 | </p> | |
71 | </div> | |
72 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
73 | <td align="left"></td> | |
74 | <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal, | |
75 | Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert | |
76 | Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani, | |
77 | Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p> | |
78 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
79 | 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>) | |
80 | </p> | |
81 | </div></td> | |
82 | </tr></table> | |
83 | <hr> | |
84 | <div class="spirit-nav"> | |
85 | <a accesskey="p" href="fp_facets/rationale.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utils.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="next_float/nextafter.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> | |
86 | </div> | |
87 | </body> | |
88 | </html> |