Boost logo

Boost-Commit :

From: pbristow_at_[hidden]
Date: 2008-04-07 13:50:33


Author: pbristow
Date: 2008-04-07 13:50:32 EDT (Mon, 07 Apr 2008)
New Revision: 44098
URL: http://svn.boost.org/trac/boost/changeset/44098

Log:
added more examples & #include line
Text files modified:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/fpclassify.qbk | 31 ++++++++++++++++++++++---------
   1 files changed, 22 insertions(+), 9 deletions(-)

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/fpclassify.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/fpclassify.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/fpclassify.qbk 2008-04-07 13:50:32 EDT (Mon, 07 Apr 2008)
@@ -1,4 +1,4 @@
-[section:fpclass Floating Point Classification: Infinities and NaN's]
+[section:fpclass Floating-Point Classification: Infinities and NaN's]
 
 [h4 Synopsis]
 
@@ -12,16 +12,20 @@
    int fpclassify(T t);
 
    template <class T>
- bool isfinite(T z);
+ bool isfinite(T z); // Neither infinity nor NaN.
 
    template <class T>
- bool isinf(T t);
+ bool isinf(T t); // Infinity (+ or -).
 
    template <class T>
- bool isnan(T t);
+ bool isnan(T t); // NaN.
 
    template <class T>
- bool isnormal(T t);
+ bool isnormal(T t); // isfinite and not denormalised.
+
+ #include <boost\math\special_functions\fpclassify.hpp>
+
+to use these functions.
 
 [h4 Description]
 
@@ -49,9 +53,18 @@
    // As above but with namespace qualification.
    (boost::math::isnan)(z);
    //
- // This will cause a compiler error is isnan is a native macro:
+ // This will cause a compiler error if isnan is a native macro:
    boost::math::isnan(z);
- // So always use (boost::math::isnan)(z); instead.
+ // So always use instead:
+ (boost::math::isnan)(z);
+ //
+ // You can also add a using statment,
+ // 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:
 
@@ -82,7 +95,7 @@
    template <class T>
    bool isnan(T t);
 
-Returns true only if /z/ is a NaN.
+Returns true only if /z/ is a [@http://en.wikipedia.org/wiki/NaN NaN].
 
    template <class T>
    bool isnormal(T t);
@@ -92,7 +105,7 @@
 [endsect] [/section:fpclass Floating Point Classification: Infinities and NaN's]
 
 [/
- Copyright 2006 John Maddock and Paul A. Bristow.
+ Copyright 2006, 2008 John Maddock and Paul A. Bristow.
   Distributed under the Boost Software License, Version 1.0.
   (See accompanying file LICENSE_1_0.txt or copy at
   http://www.boost.org/LICENSE_1_0.txt).


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk