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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user