Boost logo

Boost-Commit :

From: pbristow_at_[hidden]
Date: 2007-09-20 07:37:59


Author: pbristow
Date: 2007-09-20 07:37:57 EDT (Thu, 20 Sep 2007)
New Revision: 39402
URL: http://svn.boost.org/trac/boost/changeset/39402

Log:
Changechanged to use
if((boost::math::isinf)(x))
{
  if(x < 0) return 0;
  return 1;
}
 to get rid of 4127 warnings

but still need to supress 4127

Text files modified:
   sandbox/math_toolkit/boost/math/distributions/cauchy.hpp | 13 +++++++++----
   1 files changed, 9 insertions(+), 4 deletions(-)

Modified: sandbox/math_toolkit/boost/math/distributions/cauchy.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/cauchy.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/cauchy.hpp 2007-09-20 07:37:57 EDT (Thu, 20 Sep 2007)
@@ -206,11 +206,16 @@
    {
       return result;
    }
-
- if(std::numeric_limits<RealType>::has_infinity && abs(x) == std::numeric_limits<RealType>::infinity())
- { // pdf + and - infinity is zero.
- return 0;
+ if((boost::math::isinf)(x))
+ {
+ return 0; // pdf + and - infinity is zero.
    }
+ // These produce MSVC 4127 warnings, so the above used instead.
+ //if(std::numeric_limits<RealType>::has_infinity && abs(x) == std::numeric_limits<RealType>::infinity())
+ //{ // pdf + and - infinity is zero.
+ // return 0;
+ //}
+
    if(false == detail::check_x(function, x, &result, Policy()))
    { // Catches x = NaN
       return result;


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