From 4bd52bfe7a6cda99a7a0791cbdba32ef7d406a95 Mon Sep 17 00:00:00 2001 From: "Paul A. Bristow" Date: Thu, 20 Sep 2007 11:37:57 +0000 Subject: [PATCH] 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 [SVN r39402] --- include/boost/math/distributions/cauchy.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/boost/math/distributions/cauchy.hpp b/include/boost/math/distributions/cauchy.hpp index cc5766d2d..34e04eedb 100644 --- a/include/boost/math/distributions/cauchy.hpp +++ b/include/boost/math/distributions/cauchy.hpp @@ -206,11 +206,16 @@ inline RealType pdf(const cauchy_distribution& dist, const Rea { return result; } - - if(std::numeric_limits::has_infinity && abs(x) == std::numeric_limits::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::has_infinity && abs(x) == std::numeric_limits::infinity()) + //{ // pdf + and - infinity is zero. + // return 0; + //} + if(false == detail::check_x(function, x, &result, Policy())) { // Catches x = NaN return result;