diff --git a/include/boost/math/distributions/normal.hpp b/include/boost/math/distributions/normal.hpp index 6cca20a57..056281053 100644 --- a/include/boost/math/distributions/normal.hpp +++ b/include/boost/math/distributions/normal.hpp @@ -109,15 +109,6 @@ inline RealType pdf(const normal_distribution& dist, const Rea RealType mean = dist.mean(); static const char* function = "boost::math::pdf(const normal_distribution<%1%>&, %1%)"; - if((boost::math::isinf)(x)) - { - return 0; // pdf + and - infinity is zero. - } - // Below produces 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; - //} RealType result = 0; if(false == detail::check_scale(function, sd, &result, Policy())) @@ -128,6 +119,15 @@ inline RealType pdf(const normal_distribution& dist, const Rea { return result; } + if((boost::math::isinf)(x)) + { + return 0; // pdf + and - infinity is zero. + } + // Below produces 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())) { return result; @@ -217,6 +217,11 @@ inline RealType cdf(const complemented2_type