From e0737c56c1e384e05064a0c6e1ac46979371041b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 19 Dec 2018 22:58:32 +0100 Subject: New upstream version 2.0.0+repack --- boost/libs/math/doc/html/math_toolkit/fpclass.html | 252 +++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 boost/libs/math/doc/html/math_toolkit/fpclass.html (limited to 'boost/libs/math/doc/html/math_toolkit/fpclass.html') diff --git a/boost/libs/math/doc/html/math_toolkit/fpclass.html b/boost/libs/math/doc/html/math_toolkit/fpclass.html new file mode 100644 index 00000000..15e10c3f --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/fpclass.html @@ -0,0 +1,252 @@ + + + +Floating-Point Classification: Infinities and NaNs + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Synopsis +
+
#define FP_ZERO        /* implementation specific value */
+#define FP_NORMAL      /* implementation specific value */
+#define FP_INFINITE    /* implementation specific value */
+#define FP_NAN         /* implementation specific value */
+#define FP_SUBNORMAL   /* implementation specific value */
+
+template <class T>
+int fpclassify(T t);
+
+template <class T>
+bool isfinite(T z); // Neither infinity nor NaN.
+
+template <class T>
+bool isinf(T t); // Infinity (+ or -).
+
+template <class T>
+bool isnan(T t); // NaN.
+
+template <class T>
+bool isnormal(T t); // isfinite and not denormalised.
+
+#include <boost\math\special_functions\fpclassify.hpp>
+
+

+ to use these functions. +

+
+ + Description +
+

+ These functions provide the same functionality as the macros with the same + name in C99, indeed if the C99 macros are available, then these functions are + implemented in terms of them, otherwise they rely on std::numeric_limits<> to function. +

+

+ Note that the definition of these functions does not suppress the + definition of these names as macros by math.h on those platforms + that already provide these as macros. That mean that the following have differing + meanings: +

+
using namespace boost::math;
+
+// This might call a global macro if defined,
+// but might not work if the type of z is unsupported
+// by the std lib macro:
+isnan(z);
+//
+// This calls the Boost version
+// (found via the "using namespace boost::math" declaration)
+// it works for any type that has numeric_limits support for type z:
+(isnan)(z);
+//
+// As above but with explicit namespace qualification.
+(boost::math::isnan)(z);
+//
+// This will cause a compiler error if isnan is a native macro:
+boost::math::isnan(z);
+// So always use instead:
+(boost::math::isnan)(z);
+//
+// You can also add a using statement,
+// globally to a .cpp file, or to a local function in a .hpp file.
+using boost::math::isnan;
+// so you can write the shorter and less cluttered
+(isnan)(z)
+// But, as above, if isnan is a native macro, this causes a compiler error,
+// because the macro always 'gets' the name first, unless enclosed in () brackets.
+
+

+ Detailed descriptions for each of these functions follows: +

+
template <class T>
+int fpclassify(T t);
+
+

+ Returns an integer value that classifies the value t: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ fpclassify value +

+
+

+ class of t. +

+
+

+ FP_ZERO +

+
+

+ If t is zero. +

+
+

+ FP_NORMAL +

+
+

+ If t is a non-zero, non-denormalised finite + value. +

+
+

+ FP_INFINITE +

+
+

+ If t is plus or minus infinity. +

+
+

+ FP_NAN +

+
+

+ If t is a NaN. +

+
+

+ FP_SUBNORMAL +

+
+

+ If t is a denormalised number. +

+
+
template <class T>
+bool isfinite(T z);
+
+

+ Returns true only if z is not an infinity or a NaN. +

+
template <class T>
+bool isinf(T t);
+
+

+ Returns true only if z is plus or minus infinity. +

+
template <class T>
+bool isnan(T t);
+
+

+ Returns true only if z is a NaN. +

+
template <class T>
+bool isnormal(T t);
+
+

+ Returns true only if z is a normal number (not zero, infinite, + NaN, or denormalised). +

+
+ + Floating-point + format +
+

+ If you wish to find details of the floating-point format for any particular + processor, there is a program +

+

+ inspect_fp.cpp +

+

+ by Johan Rade which can be used to print out the processor type, endianness, + and detailed bit layout of a selection of floating-point values, including + infinity and NaNs. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + -- cgit v1.2.3