2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-26 06:42:12 +00:00

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]
This commit is contained in:
Paul A. Bristow
2007-09-20 11:37:57 +00:00
parent 03f951e92f
commit 4bd52bfe7a

View File

@@ -206,11 +206,16 @@ inline RealType pdf(const cauchy_distribution<RealType, Policy>& dist, const Rea
{
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;