Ticket #8732: math_macro.patch

File math_macro.patch, 43.3 KB (added by Mike Liang <mtliang@…>, 9 years ago)

protect against C99 math macro expansion for math and multiprecision

  • boost/math/distributions/students_t.hpp

     
    9393      return error_result;
    9494
    9595   RealType result;
    96    if (boost::math::isinf(x))
     96   if ((boost::math::isinf)(x))
    9797   { // +infinity.
    9898     normal_distribution<RealType, Policy> n(0, 1);
    9999     RealType result = pdf(n, x);
     
    144144   { // Special case with exact result.
    145145     return static_cast<RealType>(0.5);
    146146   }
    147    if (boost::math::isinf(x))
     147   if ((boost::math::isinf)(x))
    148148   { // +infinity.
    149149     normal_distribution<RealType, Policy> n(0, 1);
    150150     RealType result = cdf(n, x);
     
    376376      df, Policy());
    377377    return std::numeric_limits<RealType>::quiet_NaN(); // Undefined.
    378378  }
    379   if (boost::math::isinf(df))
     379  if ((boost::math::isinf)(df))
    380380  { // +infinity.
    381381    return 1;
    382382  }
     
    422422        df, Policy());
    423423        return std::numeric_limits<RealType>::quiet_NaN(); // Undefined.
    424424   }
    425    if (boost::math::isinf(df))
     425   if ((boost::math::isinf)(df))
    426426   { // +infinity.
    427427     return 3;
    428428   }
     
    456456      df, Policy());
    457457     return std::numeric_limits<RealType>::quiet_NaN(); // Undefined.
    458458   }
    459    if (boost::math::isinf(df))
     459   if ((boost::math::isinf)(df))
    460460   { // +infinity.
    461461     return 0;
    462462   }
  • boost/math/distributions/non_central_t.hpp

     
    206206         T non_central_t_cdf(T v, T delta, T t, bool invert, const Policy& pol)
    207207         {
    208208            BOOST_MATH_STD_USING
    209             if (boost::math::isinf(v))
     209            if ((boost::math::isinf)(v))
    210210            { // Infinite degrees of freedom, so use normal distribution located at delta.
    211211               normal_distribution<T, Policy> n(delta, 1);
    212212               return cdf(n, t);
     
    320320
    321321
    322322            value_type guess = 0;
    323             if ( (boost::math::isinf(v)) || (v > 1 / boost::math::tools::epsilon<T>()) )
     323            if ( ((boost::math::isinf)(v)) || (v > 1 / boost::math::tools::epsilon<T>()) )
    324324            { // Infinite or very large degrees of freedom, so use normal distribution located at delta.
    325325               normal_distribution<T, Policy> n(delta, 1);
    326326               if (p < q)
     
    447447         T non_central_t_pdf(T n, T delta, T t, const Policy& pol)
    448448         {
    449449            BOOST_MATH_STD_USING
    450             if (boost::math::isinf(n))
     450            if ((boost::math::isinf)(n))
    451451            { // Infinite degrees of freedom, so use normal distribution located at delta.
    452452               normal_distribution<T, Policy> n(delta, 1);
    453453               return pdf(n, t);
     
    515515         template <class T, class Policy>
    516516         T mean(T v, T delta, const Policy& pol)
    517517         {
    518             if (boost::math::isinf(v))
     518            if ((boost::math::isinf)(v))
    519519            {
    520520               return delta;
    521521            }
     
    536536         template <class T, class Policy>
    537537         T variance(T v, T delta, const Policy& pol)
    538538         {
    539             if (boost::math::isinf(v))
     539            if ((boost::math::isinf)(v))
    540540            {
    541541               return 1;
    542542            }
     
    554554         T skewness(T v, T delta, const Policy& pol)
    555555         {
    556556            BOOST_MATH_STD_USING
    557             if (boost::math::isinf(v))
     557            if ((boost::math::isinf)(v))
    558558            {
    559559               return 0;
    560560            }
     
    576576         T kurtosis_excess(T v, T delta, const Policy& pol)
    577577         {
    578578            BOOST_MATH_STD_USING
    579             if (boost::math::isinf(v))
     579            if ((boost::math::isinf)(v))
    580580            {
    581581               return 3;
    582582            }
     
    10971097            &r,
    10981098            Policy()))
    10991099               return (RealType)r;
    1100           if (boost::math::isinf(v))
     1100          if ((boost::math::isinf)(v))
    11011101          { // Infinite degrees of freedom, so use normal distribution located at delta.
    11021102             normal_distribution<RealType, Policy> n(l, 1);
    11031103             cdf(n, x);
     
    11521152            Policy()))
    11531153               return (RealType)r;
    11541154
    1155          if (boost::math::isinf(v))
     1155         if ((boost::math::isinf)(v))
    11561156         { // Infinite degrees of freedom, so use normal distribution located at delta.
    11571157             normal_distribution<RealType, Policy> n(l, 1);
    11581158             return cdf(complement(n, x));
  • boost/multiprecision/detail/default_ops.hpp

     
    11171117inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
    11181118{
    11191119   typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
    1120    return fpclassify(value_type(arg));
     1120   return (fpclassify)(value_type(arg));
    11211121}
    11221122template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
    11231123inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
    11241124{
    1125    int v = fpclassify(arg);
     1125   int v = (fpclassify)(arg);
    11261126   return (v != FP_INFINITE) && (v != FP_NAN);
    11271127}
    11281128template <class tag, class A1, class A2, class A3, class A4>
    11291129inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
    11301130{
    11311131   typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
    1132    return isfinite(value_type(arg));
     1132   return (isfinite)(value_type(arg));
    11331133}
    11341134template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
    11351135inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
    11361136{
    1137    return fpclassify(arg) == FP_NAN;
     1137   return (fpclassify)(arg) == FP_NAN;
    11381138}
    11391139template <class tag, class A1, class A2, class A3, class A4>
    11401140inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
    11411141{
    11421142   typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
    1143    return isnan(value_type(arg));
     1143   return (isnan)(value_type(arg));
    11441144}
    11451145template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
    11461146inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
    11471147{
    1148    return fpclassify(arg) == FP_INFINITE;
     1148   return (fpclassify)(arg) == FP_INFINITE;
    11491149}
    11501150template <class tag, class A1, class A2, class A3, class A4>
    11511151inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
    11521152{
    11531153   typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
    1154    return isinf(value_type(arg));
     1154   return (isinf)(value_type(arg));
    11551155}
    11561156template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
    11571157inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
    11581158{
    1159    return fpclassify(arg) == FP_NORMAL;
     1159   return (fpclassify)(arg) == FP_NORMAL;
    11601160}
    11611161template <class tag, class A1, class A2, class A3, class A4>
    11621162inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
    11631163{
    11641164   typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
    1165    return isnormal(value_type(arg));
     1165   return (isnormal)(value_type(arg));
    11661166}
    11671167
    11681168} // namespace math
     
    12491249{
    12501250   typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    12511251   number_type r = trunc(v, pol);
    1252    if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
     1252   if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
    12531253      return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, number_type(v), 0, pol);
    12541254   return r.template convert_to<int>();
    12551255}
     
    12621262inline int itrunc(const number<Backend, ExpressionTemplates>& v, const Policy& pol)
    12631263{
    12641264   number<Backend, ExpressionTemplates> r = trunc(v, pol);
    1265    if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
     1265   if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
    12661266      return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, v, 0, pol);
    12671267   return r.template convert_to<int>();
    12681268}
     
    12761276{
    12771277   typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    12781278   number_type r = trunc(v, pol);
    1279    if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
     1279   if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
    12801280      return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, number_type(v), 0L, pol);
    12811281   return r.template convert_to<long>();
    12821282}
     
    12891289inline long ltrunc(const number<T, ExpressionTemplates>& v, const Policy& pol)
    12901290{
    12911291   number<T, ExpressionTemplates> r = trunc(v, pol);
    1292    if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
     1292   if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
    12931293      return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, v, 0L, pol);
    12941294   return r.template convert_to<long>();
    12951295}
     
    13041304{
    13051305   typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    13061306   number_type r = trunc(v, pol);
    1307    if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
     1307   if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
    13081308      return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, number_type(v), 0LL, pol);
    13091309   return r.template convert_to<long long>();
    13101310}
     
    13171317inline long long lltrunc(const number<T, ExpressionTemplates>& v, const Policy& pol)
    13181318{
    13191319   number<T, ExpressionTemplates> r = trunc(v, pol);
    1320    if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
     1320   if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
    13211321      return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, v, 0LL, pol);
    13221322   return r.template convert_to<long long>();
    13231323}
     
    13471347{
    13481348   typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    13491349   number_type r = round(v, pol);
    1350    if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
     1350   if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
    13511351      return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0, pol);
    13521352   return r.template convert_to<int>();
    13531353}
     
    13601360inline int iround(const number<T, ExpressionTemplates>& v, const Policy& pol)
    13611361{
    13621362   number<T, ExpressionTemplates> r = round(v, pol);
    1363    if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
     1363   if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
    13641364      return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0, pol);
    13651365   return r.template convert_to<int>();
    13661366}
     
    13741374{
    13751375   typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    13761376   number_type r = round(v, pol);
    1377    if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
     1377   if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
    13781378      return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, number_type(v), 0L, pol);
    13791379   return r.template convert_to<long>();
    13801380}
     
    13871387inline long lround(const number<T, ExpressionTemplates>& v, const Policy& pol)
    13881388{
    13891389   number<T, ExpressionTemplates> r = round(v, pol);
    1390    if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
     1390   if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
    13911391      return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, v, 0L, pol);
    13921392   return r.template convert_to<long>();
    13931393}
     
    14021402{
    14031403   typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    14041404   number_type r = round(v, pol);
    1405    if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
     1405   if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
    14061406      return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0LL, pol);
    14071407   return r.template convert_to<long long>();
    14081408}
     
    14151415inline long long llround(const number<T, ExpressionTemplates>& v, const Policy& pol)
    14161416{
    14171417   number<T, ExpressionTemplates> r = round(v, pol);
    1418    if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
     1418   if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
    14191419      return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0LL, pol);
    14201420   return r.template convert_to<long long>();
    14211421}
  • boost/multiprecision/cpp_dec_float.hpp

     
    440440   }
    441441
    442442   // Comparison functions
    443    bool isnan   (void) const  { return (fpclass == cpp_dec_float_NaN); }
    444    bool isinf   (void) const  { return (fpclass == cpp_dec_float_inf); }
    445    bool isfinite(void) const  { return (fpclass == cpp_dec_float_finite); }
     443   bool isnan    BOOST_NO_MACRO_EXPAND(void) const  { return (fpclass == cpp_dec_float_NaN); }
     444   bool isinf    BOOST_NO_MACRO_EXPAND(void) const  { return (fpclass == cpp_dec_float_inf); }
     445   bool isfinite BOOST_NO_MACRO_EXPAND(void) const  { return (fpclass == cpp_dec_float_finite); }
    446446
    447447   bool iszero (void) const
    448448   {
     
    505505   static cpp_dec_float pow2(long long i);
    506506   ExponentType order()const
    507507   {
    508       const bool bo_order_is_zero = ((!isfinite()) || (data[0] == static_cast<boost::uint32_t>(0u)));
     508      const bool bo_order_is_zero = ((!(isfinite)()) || (data[0] == static_cast<boost::uint32_t>(0u)));
    509509      //
    510510      // Binary search to find the order of the leading term:
    511511      //
     
    609609template <unsigned Digits10, class ExponentType, class Allocator>
    610610cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator+=(const cpp_dec_float<Digits10, ExponentType, Allocator>& v)
    611611{
    612    if(isnan())
     612   if((isnan)())
    613613   {
    614614      return *this;
    615615   }
    616616
    617    if(isinf())
     617   if((isinf)())
    618618   {
    619       if(v.isinf() && (isneg() != v.isneg()))
     619      if((v.isinf)() && (isneg() != v.isneg()))
    620620      {
    621621         *this = nan();
    622622      }
     
    846846   neg = false;
    847847
    848848   // Handle special cases like zero, inf and NaN.
    849    const bool b_u_is_inf  =   isinf();
    850    const bool b_v_is_inf  = v.isinf();
     849   const bool b_u_is_inf  =   (isinf)();
     850   const bool b_v_is_inf  = (v.isinf)();
    851851   const bool b_u_is_zero =   iszero();
    852852   const bool b_v_is_zero = v.iszero();
    853853
    854    if(   (isnan() || v.isnan())
     854   if(   ((isnan)() || (v.isnan)())
    855855      || (b_u_is_inf && b_v_is_zero)
    856856      || (b_v_is_inf && b_u_is_zero)
    857857      )
     
    932932template <unsigned Digits10, class ExponentType, class Allocator>
    933933cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator/=(const cpp_dec_float<Digits10, ExponentType, Allocator>& v) 
    934934{
    935    const bool u_and_v_are_finite_and_identical = (   isfinite()
     935   const bool u_and_v_are_finite_and_identical = (   (isfinite)()
    936936      && (fpclass == v.fpclass)
    937937      && (exp     == v.exp)
    938938      && (cmp_data(v.data) == static_cast<boost::int32_t>(0)));
     
    952952   {
    953953      if(iszero())
    954954      {
    955          if(v.isnan() || v.iszero())
     955         if((v.isnan)() || v.iszero())
    956956         {
    957957            return *this = v;
    958958         }
     
    976976   neg = false;
    977977
    978978   // Handle special cases like zero, inf and NaN.
    979    const bool b_u_is_inf  = isinf();
     979   const bool b_u_is_inf  = (isinf)();
    980980   const bool b_n_is_zero = (n == static_cast<boost::int32_t>(0));
    981981
    982    if(isnan() || (b_u_is_inf && b_n_is_zero))
     982   if((isnan)() || (b_u_is_inf && b_n_is_zero))
    983983   {
    984984      return (*this = nan());
    985985   }
     
    10711071   neg = false;
    10721072
    10731073   // Handle special cases like zero, inf and NaN.
    1074    if(isnan())
     1074   if((isnan)())
    10751075   {
    10761076      return *this;
    10771077   }
    10781078
    1079    if(isinf())
     1079   if((isinf)())
    10801080   {
    10811081      *this = inf();
    10821082      if(b_neg)
     
    11651165      return *this;
    11661166   }
    11671167
    1168    if(isnan())
     1168   if((isnan)())
    11691169   {
    11701170      return *this;
    11711171   }
    11721172
    1173    if(isinf())
     1173   if((isinf)())
    11741174   {
    11751175      return *this = zero();
    11761176   }
     
    12271227{
    12281228   // Compute the square root of *this.
    12291229
    1230    if(isneg() || (!isfinite()))
     1230   if(isneg() || (!(isfinite)()))
    12311231   {
    12321232      *this = nan();
    12331233      return *this;
     
    13361336   //                -1 for *this < v
    13371337
    13381338   // Handle all non-finite cases.
    1339    if((!isfinite()) || (!v.isfinite()))
     1339   if((!(isfinite)()) || (!(v.isfinite)()))
    13401340   {
    13411341      // NaN can never equal NaN. Return an implementation-dependent
    13421342      // signed result. Also note that comparison of NaN with NaN
    13431343      // using operators greater-than or less-than is undefined.
    1344       if(isnan() || v.isnan()) { return (isnan() ? 1 : -1); }
     1344      if((isnan)() || (v.isnan)()) { return ((isnan)() ? 1 : -1); }
    13451345
    1346       if(isinf() && v.isinf())
     1346      if((isinf)() && (v.isinf)())
    13471347      {
    13481348         // Both *this and v are infinite. They are equal if they have the same sign.
    13491349         // Otherwise, *this is less than v if and only if *this is negative.
    13501350         return ((neg == v.neg) ? 0 : (neg ? -1 : 1));
    13511351      }
    13521352
    1353       if(isinf())
     1353      if((isinf)())
    13541354      {
    13551355         // *this is infinite, but v is finite.
    13561356         // So negative infinite *this is less than any finite v.
     
    14101410{
    14111411   // Check if the value of *this is identically 1 or very close to 1.
    14121412
    1413    const bool not_negative_and_is_finite = ((!neg) && isfinite());
     1413   const bool not_negative_and_is_finite = ((!neg) && (isfinite)());
    14141414
    14151415   if(not_negative_and_is_finite)
    14161416   {
     
    15061506   // Returns the double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>.
    15071507
    15081508   // Check for non-normal cpp_dec_float<Digits10, ExponentType, Allocator>.
    1509    if(!isfinite())
     1509   if(!(isfinite)())
    15101510   {
    1511       if(isnan())
     1511      if((isnan)())
    15121512      {
    15131513         return std::numeric_limits<double>::quiet_NaN();
    15141514      }
     
    15521552   // Returns the long double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>.
    15531553
    15541554   // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> is subnormal.
    1555    if(!isfinite())
     1555   if(!(isfinite)())
    15561556   {
    1557       if(isnan())
     1557      if((isnan)())
    15581558      {
    15591559         return std::numeric_limits<long double>::quiet_NaN();
    15601560      }
     
    16861686{
    16871687   // Compute the signed integer part of x.
    16881688
    1689    if(!isfinite())
     1689   if(!(isfinite)())
    16901690   {
    16911691      return *this;
    16921692   }
     
    17161716template <unsigned Digits10, class ExponentType, class Allocator>
    17171717std::string cpp_dec_float<Digits10, ExponentType, Allocator>::str(boost::intmax_t number_of_digits, std::ios_base::fmtflags f) const
    17181718{
    1719    if(this->isinf())
     1719   if((this->isinf)())
    17201720   {
    17211721      if(this->isneg())
    17221722         return "-inf";
     
    17251725      else
    17261726         return "inf";
    17271727   }
    1728    else if(this->isnan())
     1728   else if((this->isnan)())
    17291729   {
    17301730      return "nan";
    17311731   }
     
    27222722template <unsigned Digits10, class ExponentType, class Allocator>
    27232723inline int eval_fpclassify(const cpp_dec_float<Digits10, ExponentType, Allocator>& x)
    27242724{
    2725    if(x.isinf())
     2725   if((x.isinf)())
    27262726      return FP_INFINITE;
    2727    if(x.isnan())
     2727   if((x.isnan)())
    27282728      return FP_NAN;
    27292729   if(x.iszero())
    27302730      return FP_ZERO;
     
    27582758inline void eval_floor(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) 
    27592759{
    27602760   result = x;
    2761    if(!x.isfinite() || x.isint())
     2761   if(!(x.isfinite)() || x.isint())
    27622762   {
    27632763      return;
    27642764   }
     
    27722772inline void eval_ceil(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) 
    27732773{
    27742774   result = x;
    2775    if(!x.isfinite() || x.isint())
     2775   if(!(x.isfinite)() || x.isint())
    27762776   {
    27772777      return;
    27782778   }
     
    27852785template <unsigned Digits10, class ExponentType, class Allocator>
    27862786inline void eval_trunc(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x)
    27872787{
    2788    if(!x.isfinite())
     2788   if(!(x.isfinite)())
    27892789   {
    27902790      result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number<cpp_dec_float<Digits10, ExponentType, Allocator> >(x), number<cpp_dec_float<Digits10, ExponentType, Allocator> >(x), boost::math::policies::policy<>()).backend();
    27912791      return;
     
    28442844
    28452845   result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t);
    28462846
    2847    if(result.iszero() || result.isinf() || result.isnan())
     2847   if(result.iszero() || (result.isinf)() || (result.isnan)())
    28482848   {
    28492849      // pow2 overflowed, slip the calculation up:
    28502850      result = x;
  • libs/math/test/test_students_t.cpp

     
    634634  if(std::numeric_limits<RealType>::has_quiet_NaN)
    635635  {
    636636  // Mean
    637     BOOST_CHECK(boost::math::isnan(mean(ignore_error_students_t(-1))));
    638     BOOST_CHECK(boost::math::isnan(mean(ignore_error_students_t(0))));
    639     BOOST_CHECK(boost::math::isnan(mean(ignore_error_students_t(1))));
     637    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(-1))));
     638    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(0))));
     639    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(1))));
    640640
    641641    // Variance
    642     BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
    643     BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(-1))));
    644     BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(0))));
    645     BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(1))));
    646     BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(static_cast<RealType>(1.7L)))));
    647     BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(2))));
     642    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
     643    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(-1))));
     644    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(0))));
     645    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(1))));
     646    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(static_cast<RealType>(1.7L)))));
     647    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(2))));
    648648
    649649  // Skewness
    650     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
    651     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(-1))));
    652     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(0))));
    653     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(1))));
    654     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(2))));
    655     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(3))));
     650    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
     651    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(-1))));
     652    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(0))));
     653    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(1))));
     654    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(2))));
     655    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(3))));
    656656
    657657  // Kurtosis
    658     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
    659     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(-1))));
    660     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(0))));
    661     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(1))));
    662     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(2))));
    663     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
    664     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(3))));
    665     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(4))));
     658    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
     659    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(-1))));
     660    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(0))));
     661    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(1))));
     662    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(2))));
     663    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
     664    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(3))));
     665    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(4))));
    666666 
    667667    // Kurtosis excess
    668     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
    669     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(-1))));
    670     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(0))));
    671     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(1))));
    672     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(2))));
    673     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
    674     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(3))));
    675     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(4))));
     668    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
     669    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(-1))));
     670    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(0))));
     671    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(1))));
     672    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(2))));
     673    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
     674    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(3))));
     675    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(4))));
    676676  } // has_quiet_NaN
    677677
    678   BOOST_CHECK(boost::math::isfinite(mean(ignore_error_students_t(1 + std::numeric_limits<RealType>::epsilon()))));
    679   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon()))));
    680   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
    681   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon()))));
    682   BOOST_CHECK(boost::math::isfinite(skewness(ignore_error_students_t(3 + 3 * std::numeric_limits<RealType>::epsilon()))));
    683   BOOST_CHECK(boost::math::isfinite(kurtosis(ignore_error_students_t(4 + 4 * std::numeric_limits<RealType>::epsilon()))));
    684   BOOST_CHECK(boost::math::isfinite(kurtosis(ignore_error_students_t(static_cast<RealType>(4.0001L)))));
     678  BOOST_CHECK((boost::math::isfinite)(mean(ignore_error_students_t(1 + std::numeric_limits<RealType>::epsilon()))));
     679  BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon()))));
     680  BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
     681  BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon()))));
     682  BOOST_CHECK((boost::math::isfinite)(skewness(ignore_error_students_t(3 + 3 * std::numeric_limits<RealType>::epsilon()))));
     683  BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_students_t(4 + 4 * std::numeric_limits<RealType>::epsilon()))));
     684  BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_students_t(static_cast<RealType>(4.0001L)))));
    685685
    686686  // check_out_of_range<students_t_distribution<RealType> >(1);
    687687  // Cannot be used because fails "exception std::domain_error is expected"
  • libs/math/test/test_airy.cpp

     
    4949   for(unsigned i = 0; i < data.size(); ++i)
    5050   {
    5151      BOOST_CHECK_CLOSE_FRACTION(data[i][1], boost::math::airy_ai(data[i][0]), tol);
    52       if(boost::math::isfinite(data[i][2]))
     52      if((boost::math::isfinite)(data[i][2]))
    5353         BOOST_CHECK_CLOSE_FRACTION(data[i][2], boost::math::airy_bi(data[i][0]), tol);
    5454      BOOST_CHECK_CLOSE_FRACTION(data[i][3], boost::math::airy_ai_prime(data[i][0]), tol);
    55       if(boost::math::isfinite(data[i][4]))
     55      if((boost::math::isfinite)(data[i][4]))
    5656         BOOST_CHECK_CLOSE_FRACTION(data[i][4], boost::math::airy_bi_prime(data[i][0]), tol);
    5757   }
    5858}
  • libs/math/test/test_nc_t.cpp

     
    737737  if(std::numeric_limits<RealType>::has_quiet_NaN)
    738738  {
    739739  // Mean
    740     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(-nan, 0))));
    741     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(+nan, 0))));
    742     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(-1, 0))));
    743     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(0, 0))));
    744     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(1, 0))));
    745     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(2, nan))));
    746     BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(nan, nan))));
    747     BOOST_CHECK(boost::math::isfinite(mean(ignore_error_non_central_t(2, 0)))); // OK
     740    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(-nan, 0))));
     741    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(+nan, 0))));
     742    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(-1, 0))));
     743    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(0, 0))));
     744    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(1, 0))));
     745    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(2, nan))));
     746    BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(nan, nan))));
     747    BOOST_CHECK((boost::math::isfinite)(mean(ignore_error_non_central_t(2, 0)))); // OK
    748748
    749749    // Variance
    750     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(nan, 0))));
    751     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(1, nan))));
    752     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(2, nan))));
    753     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(-1, 0))));
    754     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(0, 0))));
    755     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(1, 0))));
    756     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(static_cast<RealType>(1.7L), 0))));
    757     BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(2, 0))));
     750    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(nan, 0))));
     751    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(1, nan))));
     752    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(2, nan))));
     753    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(-1, 0))));
     754    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(0, 0))));
     755    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(1, 0))));
     756    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(static_cast<RealType>(1.7L), 0))));
     757    BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(2, 0))));
    758758
    759759  // Skewness
    760     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
    761     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(-1, 0))));
    762     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(0, 0))));
    763     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(1, 0))));
    764     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(2, 0))));
    765     BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(3, 0))));
     760    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
     761    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(-1, 0))));
     762    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(0, 0))));
     763    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(1, 0))));
     764    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(2, 0))));
     765    BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(3, 0))));
    766766
    767767  // Kurtosis
    768     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
    769     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(-1, 0))));
    770     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(0, 0))));
    771     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(1, 0))));
    772     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(2, 0))));
    773     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
    774     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(3, 0))));
    775     BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(4, 0))));
     768    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
     769    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(-1, 0))));
     770    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(0, 0))));
     771    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(1, 0))));
     772    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(2, 0))));
     773    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
     774    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(3, 0))));
     775    BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(4, 0))));
    776776 
    777777    // Kurtosis excess
    778     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
    779     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(-1, 0))));
    780     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(0, 0))));
    781     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(1, 0))));
    782     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(2, 0))));
    783     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
    784     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(3, 0))));
    785     BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(4, 0))));
     778    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
     779    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(-1, 0))));
     780    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(0, 0))));
     781    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(1, 0))));
     782    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(2, 0))));
     783    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
     784    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(3, 0))));
     785    BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(4, 0))));
    786786  } // has_quiet_NaN
    787787
    788   BOOST_CHECK(boost::math::isfinite(mean(ignore_error_non_central_t(1 + std::numeric_limits<RealType>::epsilon(), 0))));
    789   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));
    790   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
    791   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));
    792   BOOST_CHECK(boost::math::isfinite(skewness(ignore_error_non_central_t(3 + 3 * std::numeric_limits<RealType>::epsilon(), 0))));
    793   BOOST_CHECK(boost::math::isfinite(kurtosis(ignore_error_non_central_t(4 + 4 * std::numeric_limits<RealType>::epsilon(), 0))));
    794   BOOST_CHECK(boost::math::isfinite(kurtosis(ignore_error_non_central_t(static_cast<RealType>(4.0001L), 0))));
     788  BOOST_CHECK((boost::math::isfinite)(mean(ignore_error_non_central_t(1 + std::numeric_limits<RealType>::epsilon(), 0))));
     789  BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));
     790  BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
     791  BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));
     792  BOOST_CHECK((boost::math::isfinite)(skewness(ignore_error_non_central_t(3 + 3 * std::numeric_limits<RealType>::epsilon(), 0))));
     793  BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_non_central_t(4 + 4 * std::numeric_limits<RealType>::epsilon(), 0))));
     794  BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_non_central_t(static_cast<RealType>(4.0001L), 0))));
    795795
    796796  // check_out_of_range<non_central_t_distribution<RealType> >(1, 0); // Fails one check because allows df = infinity.
    797797  check_support<non_central_t_distribution<RealType> >(non_central_t_distribution<RealType>(1, 0));
  • libs/math/test/complex_test.cpp

     
    406406      BOOST_CHECK((boost::math::isnan)(result.real()));
    407407      BOOST_CHECK(result.imag() == infinity);
    408408   }
    409    if(boost::math::signbit(mzero))
     409   if((boost::math::signbit)(mzero))
    410410   {
    411411      result = boost::math::acos(ct(-1.25f, zero));
    412412      BOOST_CHECK(result.real() > 0);
     
    537537      BOOST_CHECK((boost::math::isnan)(result.real()));
    538538      BOOST_CHECK((boost::math::isnan)(result.imag()));
    539539   }
    540    if(boost::math::signbit(mzero))
     540   if((boost::math::signbit)(mzero))
    541541   {
    542542      result = boost::math::acosh(ct(-2.5f, zero));
    543543      BOOST_CHECK(result.real() > 0);
     
    669669      BOOST_CHECK(std::fabs(result.real()) == infinity);
    670670      BOOST_CHECK((boost::math::isnan)(result.imag()));
    671671   }
    672    if(boost::math::signbit(mzero))
     672   if((boost::math::signbit)(mzero))
    673673   {
    674674      result = boost::math::asinh(ct(zero, 1.5f));
    675675      BOOST_CHECK(result.real() > 0);
     
    817817      BOOST_CHECK((boost::math::isnan)(result.imag()));
    818818
    819819   }
    820    if(boost::math::signbit(mzero))
     820   if((boost::math::signbit)(mzero))
    821821   {
    822822      result = boost::math::atanh(ct(-2.0f, mzero));
    823823      BOOST_CHECK(result.real() < 0);
  • libs/multiprecision/test/test_arithmetic.hpp

     
    813813   {
    814814      if(std::numeric_limits<Real>::has_infinity)
    815815      {
    816          BOOST_CHECK(boost::math::isinf(Real(20) / 0u));
     816         BOOST_CHECK((boost::math::isinf)(Real(20) / 0u));
    817817      }
    818818      else
    819819      {
  • libs/multiprecision/test/test_numeric_limits.cpp

     
    7272   Number minv, maxv;
    7373   minv = (std::numeric_limits<Number>::min)();
    7474   maxv = (std::numeric_limits<Number>::max)();
    75    BOOST_CHECK(boost::math::isnormal(minv));
    76    BOOST_CHECK(boost::math::isnormal(maxv));
    77    BOOST_CHECK(boost::math::isnormal(log(minv)));
    78    BOOST_CHECK(boost::math::isnormal(log(maxv)));
    79    BOOST_CHECK(boost::math::isnormal(sqrt(minv)));
    80    BOOST_CHECK(boost::math::isnormal(sqrt(maxv)));
     75   BOOST_CHECK((boost::math::isnormal)(minv));
     76   BOOST_CHECK((boost::math::isnormal)(maxv));
     77   BOOST_CHECK((boost::math::isnormal)(log(minv)));
     78   BOOST_CHECK((boost::math::isnormal)(log(maxv)));
     79   BOOST_CHECK((boost::math::isnormal)(sqrt(minv)));
     80   BOOST_CHECK((boost::math::isnormal)(sqrt(maxv)));
    8181
    8282   if(std::numeric_limits<Number>::is_specialized)
    8383   {
  • libs/multiprecision/test/test_float_io.cpp

     
    201201      T val = std::numeric_limits<T>::quiet_NaN();
    202202      BOOST_CHECK_EQUAL(val.str(), "nan");
    203203      val = static_cast<T>("nan");
    204       BOOST_CHECK(boost::math::isnan(val));
     204      BOOST_CHECK((boost::math::isnan)(val));
    205205   }
    206206}
    207207