Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84921 - in trunk: boost/multiprecision boost/multiprecision/detail libs/math/test libs/multiprecision/test libs/multiprecision/test/concepts
From: john_at_[hidden]
Date: 2013-07-01 11:43:28


Author: johnmaddock
Date: 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013)
New Revision: 84921
URL: http://svn.boost.org/trac/boost/changeset/84921

Log:
Apply remaining fixes from #8732.
Also adds msb (most significant bit) function to multiprecision.
Fixes #8732.

Text files modified:
   trunk/boost/multiprecision/cpp_dec_float.hpp | 74 +++++++++++++++++++-------------------
   trunk/boost/multiprecision/debug_adaptor.hpp | 7 +++
   trunk/boost/multiprecision/detail/default_ops.hpp | 73 +++++++++++++++++++++++++++-----------
   trunk/boost/multiprecision/detail/integer_ops.hpp | 18 +++++++++
   trunk/boost/multiprecision/integer.hpp | 24 ++++++++++++
   trunk/boost/multiprecision/logged_adaptor.hpp | 10 +++++
   trunk/libs/math/test/test_archive.cpp | 10 ++--
   trunk/libs/math/test/test_bessel_airy_zeros.cpp | 14 ++++---
   trunk/libs/math/test/test_classify.cpp | 2 +
   trunk/libs/math/test/test_error_handling.cpp | 2 +
   trunk/libs/math/test/test_nc_t.cpp | 75 +++++++++++++++++++--------------------
   trunk/libs/math/test/test_nonfinite_io.cpp | 2
   trunk/libs/math/test/test_owens_t.cpp | 2
   trunk/libs/math/test/test_students_t.cpp | 62 ++++++++++++++++----------------
   trunk/libs/math/test/test_triangular.cpp | 2
   trunk/libs/math/test/test_uniform.cpp | 2
   trunk/libs/multiprecision/test/concepts/number_concept_check.cpp | 2 +
   trunk/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp | 2 +
   trunk/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp | 2 +
   trunk/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp | 2 +
   trunk/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp | 2 +
   trunk/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp | 2 +
   trunk/libs/multiprecision/test/test_arithmetic.hpp | 2
   trunk/libs/multiprecision/test/test_float_io.cpp | 2
   trunk/libs/multiprecision/test/test_numeric_limits.cpp | 12 +++---
   25 files changed, 257 insertions(+), 150 deletions(-)

Modified: trunk/boost/multiprecision/cpp_dec_float.hpp
==============================================================================
--- trunk/boost/multiprecision/cpp_dec_float.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/boost/multiprecision/cpp_dec_float.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -440,9 +440,9 @@
    }
 
    // Comparison functions
- bool isnan (void) const { return (fpclass == cpp_dec_float_NaN); }
- bool isinf (void) const { return (fpclass == cpp_dec_float_inf); }
- bool isfinite(void) const { return (fpclass == cpp_dec_float_finite); }
+ bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(void) const { return (fpclass == cpp_dec_float_NaN); }
+ bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(void) const { return (fpclass == cpp_dec_float_inf); }
+ bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(void) const { return (fpclass == cpp_dec_float_finite); }
 
    bool iszero (void) const
    {
@@ -505,7 +505,7 @@
    static cpp_dec_float pow2(long long i);
    ExponentType order()const
    {
- const bool bo_order_is_zero = ((!isfinite()) || (data[0] == static_cast<boost::uint32_t>(0u)));
+ const bool bo_order_is_zero = ((!(isfinite)()) || (data[0] == static_cast<boost::uint32_t>(0u)));
       //
       // Binary search to find the order of the leading term:
       //
@@ -609,14 +609,14 @@
 template <unsigned Digits10, class ExponentType, class Allocator>
 cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator+=(const cpp_dec_float<Digits10, ExponentType, Allocator>& v)
 {
- if(isnan())
+ if((isnan)())
    {
       return *this;
    }
 
- if(isinf())
+ if((isinf)())
    {
- if(v.isinf() && (isneg() != v.isneg()))
+ if((v.isinf)() && (isneg() != v.isneg()))
       {
          *this = nan();
       }
@@ -846,12 +846,12 @@
    neg = false;
 
    // Handle special cases like zero, inf and NaN.
- const bool b_u_is_inf = isinf();
- const bool b_v_is_inf = v.isinf();
+ const bool b_u_is_inf = (isinf)();
+ const bool b_v_is_inf = (v.isinf)();
    const bool b_u_is_zero = iszero();
    const bool b_v_is_zero = v.iszero();
 
- if( (isnan() || v.isnan())
+ if( ((isnan)() || (v.isnan)())
       || (b_u_is_inf && b_v_is_zero)
       || (b_v_is_inf && b_u_is_zero)
       )
@@ -932,7 +932,7 @@
 template <unsigned Digits10, class ExponentType, class Allocator>
 cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator/=(const cpp_dec_float<Digits10, ExponentType, Allocator>& v)
 {
- const bool u_and_v_are_finite_and_identical = ( isfinite()
+ const bool u_and_v_are_finite_and_identical = ( (isfinite)()
       && (fpclass == v.fpclass)
       && (exp == v.exp)
       && (cmp_data(v.data) == static_cast<boost::int32_t>(0)));
@@ -952,7 +952,7 @@
    {
       if(iszero())
       {
- if(v.isnan() || v.iszero())
+ if((v.isnan)() || v.iszero())
          {
             return *this = v;
          }
@@ -976,10 +976,10 @@
    neg = false;
 
    // Handle special cases like zero, inf and NaN.
- const bool b_u_is_inf = isinf();
+ const bool b_u_is_inf = (isinf)();
    const bool b_n_is_zero = (n == static_cast<boost::int32_t>(0));
 
- if(isnan() || (b_u_is_inf && b_n_is_zero))
+ if((isnan)() || (b_u_is_inf && b_n_is_zero))
    {
       return (*this = nan());
    }
@@ -1071,12 +1071,12 @@
    neg = false;
 
    // Handle special cases like zero, inf and NaN.
- if(isnan())
+ if((isnan)())
    {
       return *this;
    }
 
- if(isinf())
+ if((isinf)())
    {
       *this = inf();
       if(b_neg)
@@ -1165,12 +1165,12 @@
       return *this;
    }
 
- if(isnan())
+ if((isnan)())
    {
       return *this;
    }
 
- if(isinf())
+ if((isinf)())
    {
       return *this = zero();
    }
@@ -1227,7 +1227,7 @@
 {
    // Compute the square root of *this.
 
- if(isneg() || (!isfinite()))
+ if(isneg() || (!(isfinite)()))
    {
       *this = nan();
       return *this;
@@ -1336,21 +1336,21 @@
    // -1 for *this < v
 
    // Handle all non-finite cases.
- if((!isfinite()) || (!v.isfinite()))
+ if((!(isfinite)()) || (!(v.isfinite)()))
    {
       // NaN can never equal NaN. Return an implementation-dependent
       // signed result. Also note that comparison of NaN with NaN
       // using operators greater-than or less-than is undefined.
- if(isnan() || v.isnan()) { return (isnan() ? 1 : -1); }
+ if((isnan)() || (v.isnan)()) { return ((isnan)() ? 1 : -1); }
 
- if(isinf() && v.isinf())
+ if((isinf)() && (v.isinf)())
       {
          // Both *this and v are infinite. They are equal if they have the same sign.
          // Otherwise, *this is less than v if and only if *this is negative.
          return ((neg == v.neg) ? 0 : (neg ? -1 : 1));
       }
 
- if(isinf())
+ if((isinf)())
       {
          // *this is infinite, but v is finite.
          // So negative infinite *this is less than any finite v.
@@ -1410,7 +1410,7 @@
 {
    // Check if the value of *this is identically 1 or very close to 1.
 
- const bool not_negative_and_is_finite = ((!neg) && isfinite());
+ const bool not_negative_and_is_finite = ((!neg) && (isfinite)());
 
    if(not_negative_and_is_finite)
    {
@@ -1506,9 +1506,9 @@
    // Returns the double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>.
 
    // Check for non-normal cpp_dec_float<Digits10, ExponentType, Allocator>.
- if(!isfinite())
+ if(!(isfinite)())
    {
- if(isnan())
+ if((isnan)())
       {
          return std::numeric_limits<double>::quiet_NaN();
       }
@@ -1552,9 +1552,9 @@
    // Returns the long double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>.
 
    // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> is subnormal.
- if(!isfinite())
+ if(!(isfinite)())
    {
- if(isnan())
+ if((isnan)())
       {
          return std::numeric_limits<long double>::quiet_NaN();
       }
@@ -1686,7 +1686,7 @@
 {
    // Compute the signed integer part of x.
 
- if(!isfinite())
+ if(!(isfinite)())
    {
       return *this;
    }
@@ -1716,7 +1716,7 @@
 template <unsigned Digits10, class ExponentType, class Allocator>
 std::string cpp_dec_float<Digits10, ExponentType, Allocator>::str(boost::intmax_t number_of_digits, std::ios_base::fmtflags f) const
 {
- if(this->isinf())
+ if((this->isinf)())
    {
       if(this->isneg())
          return "-inf";
@@ -1725,7 +1725,7 @@
       else
          return "inf";
    }
- else if(this->isnan())
+ else if((this->isnan)())
    {
       return "nan";
    }
@@ -2722,9 +2722,9 @@
 template <unsigned Digits10, class ExponentType, class Allocator>
 inline int eval_fpclassify(const cpp_dec_float<Digits10, ExponentType, Allocator>& x)
 {
- if(x.isinf())
+ if((x.isinf)())
       return FP_INFINITE;
- if(x.isnan())
+ if((x.isnan)())
       return FP_NAN;
    if(x.iszero())
       return FP_ZERO;
@@ -2758,7 +2758,7 @@
 inline void eval_floor(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x)
 {
    result = x;
- if(!x.isfinite() || x.isint())
+ if(!(x.isfinite)() || x.isint())
    {
       return;
    }
@@ -2772,7 +2772,7 @@
 inline void eval_ceil(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x)
 {
    result = x;
- if(!x.isfinite() || x.isint())
+ if(!(x.isfinite)() || x.isint())
    {
       return;
    }
@@ -2785,7 +2785,7 @@
 template <unsigned Digits10, class ExponentType, class Allocator>
 inline void eval_trunc(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x)
 {
- if(!x.isfinite())
+ if(!(x.isfinite)())
    {
       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();
       return;
@@ -2844,7 +2844,7 @@
 
    result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t);
 
- if(result.iszero() || result.isinf() || result.isnan())
+ if(result.iszero() || (result.isinf)() || (result.isnan)())
    {
       // pow2 overflowed, slip the calculation up:
       result = x;

Modified: trunk/boost/multiprecision/debug_adaptor.hpp
==============================================================================
--- trunk/boost/multiprecision/debug_adaptor.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/boost/multiprecision/debug_adaptor.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -336,6 +336,13 @@
 }
 
 template <class Backend>
+inline unsigned eval_msb(const debug_adaptor<Backend>& arg)
+{
+ using default_ops::eval_msb;
+ return eval_msb(arg.value());
+}
+
+template <class Backend>
 inline bool eval_bit_test(const debug_adaptor<Backend>& arg, unsigned a)
 {
    using default_ops::eval_bit_test;

Modified: trunk/boost/multiprecision/detail/default_ops.hpp
==============================================================================
--- trunk/boost/multiprecision/detail/default_ops.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/boost/multiprecision/detail/default_ops.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -1020,6 +1020,15 @@
 inline unsigned eval_lsb(const T& val)
 {
    typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
+ int c = eval_get_sign(val);
+ if(c == 0)
+ {
+ BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
+ }
+ if(c < 0)
+ {
+ BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
+ }
    unsigned result = 0;
    T mask, t;
    mask = ui_type(1);
@@ -1035,6 +1044,28 @@
 }
 
 template <class T>
+inline int eval_msb(const T& val)
+{
+ int c = eval_get_sign(val);
+ if(c == 0)
+ {
+ BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
+ }
+ if(c < 0)
+ {
+ BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
+ }
+ unsigned result = 0;
+ T t(val);
+ while(!eval_is_zero(t))
+ {
+ eval_right_shift(t, 1);
+ ++result;
+ }
+ return --result;
+}
+
+template <class T>
 inline bool eval_bit_test(const T& val, unsigned index)
 {
    typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
@@ -1117,52 +1148,52 @@
 inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
 {
    typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
- return fpclassify(value_type(arg));
+ return (fpclassify)(value_type(arg));
 }
 template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
 inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
 {
- int v = fpclassify(arg);
+ int v = (fpclassify)(arg);
    return (v != FP_INFINITE) && (v != FP_NAN);
 }
 template <class tag, class A1, class A2, class A3, class A4>
 inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
 {
    typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
- return isfinite(value_type(arg));
+ return (isfinite)(value_type(arg));
 }
 template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
 inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
 {
- return fpclassify(arg) == FP_NAN;
+ return (fpclassify)(arg) == FP_NAN;
 }
 template <class tag, class A1, class A2, class A3, class A4>
 inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
 {
    typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
- return isnan(value_type(arg));
+ return (isnan)(value_type(arg));
 }
 template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
 inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
 {
- return fpclassify(arg) == FP_INFINITE;
+ return (fpclassify)(arg) == FP_INFINITE;
 }
 template <class tag, class A1, class A2, class A3, class A4>
 inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
 {
    typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
- return isinf(value_type(arg));
+ return (isinf)(value_type(arg));
 }
 template <class Backend, multiprecision::expression_template_option ExpressionTemplates>
 inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg)
 {
- return fpclassify(arg) == FP_NORMAL;
+ return (fpclassify)(arg) == FP_NORMAL;
 }
 template <class tag, class A1, class A2, class A3, class A4>
 inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg)
 {
    typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type;
- return isnormal(value_type(arg));
+ return (isnormal)(value_type(arg));
 }
 
 } // namespace math
@@ -1249,7 +1280,7 @@
 {
    typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    number_type r = trunc(v, pol);
- if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, number_type(v), 0, pol);
    return r.template convert_to<int>();
 }
@@ -1262,7 +1293,7 @@
 inline int itrunc(const number<Backend, ExpressionTemplates>& v, const Policy& pol)
 {
    number<Backend, ExpressionTemplates> r = trunc(v, pol);
- if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, v, 0, pol);
    return r.template convert_to<int>();
 }
@@ -1276,7 +1307,7 @@
 {
    typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    number_type r = trunc(v, pol);
- if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, number_type(v), 0L, pol);
    return r.template convert_to<long>();
 }
@@ -1289,7 +1320,7 @@
 inline long ltrunc(const number<T, ExpressionTemplates>& v, const Policy& pol)
 {
    number<T, ExpressionTemplates> r = trunc(v, pol);
- if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, v, 0L, pol);
    return r.template convert_to<long>();
 }
@@ -1304,7 +1335,7 @@
 {
    typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    number_type r = trunc(v, pol);
- if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, number_type(v), 0LL, pol);
    return r.template convert_to<long long>();
 }
@@ -1317,7 +1348,7 @@
 inline long long lltrunc(const number<T, ExpressionTemplates>& v, const Policy& pol)
 {
    number<T, ExpressionTemplates> r = trunc(v, pol);
- if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, v, 0LL, pol);
    return r.template convert_to<long long>();
 }
@@ -1347,7 +1378,7 @@
 {
    typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    number_type r = round(v, pol);
- if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0, pol);
    return r.template convert_to<int>();
 }
@@ -1360,7 +1391,7 @@
 inline int iround(const number<T, ExpressionTemplates>& v, const Policy& pol)
 {
    number<T, ExpressionTemplates> r = round(v, pol);
- if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0, pol);
    return r.template convert_to<int>();
 }
@@ -1374,7 +1405,7 @@
 {
    typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    number_type r = round(v, pol);
- if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, number_type(v), 0L, pol);
    return r.template convert_to<long>();
 }
@@ -1387,7 +1418,7 @@
 inline long lround(const number<T, ExpressionTemplates>& v, const Policy& pol)
 {
    number<T, ExpressionTemplates> r = round(v, pol);
- if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, v, 0L, pol);
    return r.template convert_to<long>();
 }
@@ -1402,7 +1433,7 @@
 {
    typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
    number_type r = round(v, pol);
- if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0LL, pol);
    return r.template convert_to<long long>();
 }
@@ -1415,7 +1446,7 @@
 inline long long llround(const number<T, ExpressionTemplates>& v, const Policy& pol)
 {
    number<T, ExpressionTemplates> r = round(v, pol);
- if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !boost::math::isfinite(v))
+ if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v))
       return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0LL, pol);
    return r.template convert_to<long long>();
 }

Modified: trunk/boost/multiprecision/detail/integer_ops.hpp
==============================================================================
--- trunk/boost/multiprecision/detail/integer_ops.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/boost/multiprecision/detail/integer_ops.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -195,6 +195,24 @@
 }
 
 template <class Backend, expression_template_option ExpressionTemplates>
+inline typename enable_if_c<number_category<Backend>::value == number_kind_integer, unsigned>::type
+ msb(const number<Backend, ExpressionTemplates>& x)
+{
+ using default_ops::eval_msb;
+ return eval_msb(x.backend());
+}
+
+template <class tag, class A1, class A2, class A3, class A4>
+inline typename enable_if_c<number_category<typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type>::value == number_kind_integer, unsigned>::type
+ msb(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& x)
+{
+ typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type number_type;
+ number_type n(x);
+ using default_ops::eval_msb;
+ return eval_msb(n.backend());
+}
+
+template <class Backend, expression_template_option ExpressionTemplates>
 inline typename enable_if_c<number_category<Backend>::value == number_kind_integer, bool>::type
    bit_test(const number<Backend, ExpressionTemplates>& x, unsigned index)
 {

Modified: trunk/boost/multiprecision/integer.hpp
==============================================================================
--- trunk/boost/multiprecision/integer.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/boost/multiprecision/integer.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -126,6 +126,30 @@
 }
 
 template <class Integer>
+typename enable_if_c<is_integral<Integer>::value, unsigned>::type msb(Integer val)
+{
+ if(val <= 0)
+ {
+ if(val == 0)
+ {
+ BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
+ }
+ else
+ {
+ BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
+ }
+ }
+ unsigned index = 0;
+
+ while(val)
+ {
+ ++index;
+ val >>= 1;
+ }
+ return --index;
+}
+
+template <class Integer>
 typename enable_if_c<is_integral<Integer>::value, bool>::type bit_test(const Integer& val, unsigned index)
 {
    Integer mask = 1;

Modified: trunk/boost/multiprecision/logged_adaptor.hpp
==============================================================================
--- trunk/boost/multiprecision/logged_adaptor.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/boost/multiprecision/logged_adaptor.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -384,6 +384,16 @@
 }
 
 template <class Backend>
+inline unsigned eval_msb(const logged_adaptor<Backend>& arg)
+{
+ using default_ops::eval_msb;
+ log_prefix_event(arg.value(), "most-significant-bit");
+ unsigned r = eval_msb(arg.value());
+ log_postfix_event(arg.value(), r, "most-significant-bit");
+ return r;
+}
+
+template <class Backend>
 inline bool eval_bit_test(const logged_adaptor<Backend>& arg, unsigned a)
 {
    using default_ops::eval_bit_test;

Modified: trunk/libs/math/test/test_archive.cpp
==============================================================================
--- trunk/libs/math/test/test_archive.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_archive.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -37,7 +37,7 @@
 using namespace boost::math;
 using boost::math::signbit;
 using boost::math::changesign;
-using boost::math::isnan;
+using (boost::math::isnan)(;
 
 //------------------------------------------------------------------------------
 
@@ -89,17 +89,17 @@
     ValType a3 = std::numeric_limits<ValType>::infinity();
     BOOST_CHECK((boost::math::isinf)(a3));
     ValType a4 = std::numeric_limits<ValType>::quiet_NaN();
- BOOST_CHECK((boost::math::isnan)(a4));
+ BOOST_CHECK(((boost::math::isnan)()(a4));
     ValType a5 = std::numeric_limits<ValType>::signaling_NaN();
- BOOST_CHECK((boost::math::isnan)(a5));
+ BOOST_CHECK(((boost::math::isnan)()(a5));
     ValType a6 = (changesign)(static_cast<ValType>(0));
     ValType a7 = static_cast<ValType>(-57.13);
     ValType a8 = -std::numeric_limits<ValType>::infinity();
     BOOST_CHECK((boost::math::isinf)(a8));
     ValType a9 = -std::numeric_limits<ValType>::quiet_NaN();
- BOOST_CHECK((boost::math::isnan)(a9));
+ BOOST_CHECK(((boost::math::isnan)()(a9));
     ValType a10 = -std::numeric_limits<ValType>::signaling_NaN();
- BOOST_CHECK((boost::math::isnan)(a10));
+ BOOST_CHECK(((boost::math::isnan)()(a10));
 
     {
         OArchiveType oa(ss, no_codecvt);

Modified: trunk/libs/math/test/test_bessel_airy_zeros.cpp
==============================================================================
--- trunk/libs/math/test/test_bessel_airy_zeros.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_bessel_airy_zeros.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -25,6 +25,8 @@
 #include <boost/test/floating_point_comparison.hpp>
 
 #include <typeinfo>
+#include <iostream>
+#include <iomanip>
 
 // #include <boost/math/tools/
 //
@@ -386,7 +388,7 @@
   {
     BOOST_CHECK_THROW(cyl_bessel_j_zero(static_cast<RealType>(std::numeric_limits<RealType>::quiet_NaN()), 1), std::domain_error);
     // Check that bad m returns NaN if policy is no throws.
- BOOST_CHECK(boost::math::isnan<RealType>(cyl_bessel_j_zero(std::numeric_limits<RealType>::quiet_NaN(), 1, ignore_all_policy())) );
+ BOOST_CHECK((boost::math::isnan<RealType>)(cyl_bessel_j_zero(std::numeric_limits<RealType>::quiet_NaN(), 1, ignore_all_policy())) );
     BOOST_CHECK_THROW(boost::math::cyl_bessel_j_zero(static_cast<RealType>(std::numeric_limits<RealType>::quiet_NaN()), -1), std::domain_error);
   }
   else
@@ -400,7 +402,7 @@
     BOOST_CHECK_THROW(cyl_bessel_j_zero(std::numeric_limits<RealType>::infinity(), 0), std::domain_error);
     BOOST_CHECK_THROW(cyl_bessel_j_zero(std::numeric_limits<RealType>::infinity(), 1), std::domain_error);
     // Check that NaN is returned if error ignored.
- BOOST_CHECK(boost::math::isnan<RealType>(cyl_bessel_j_zero(std::numeric_limits<RealType>::infinity(), 1, ignore_all_policy())) );
+ BOOST_CHECK((boost::math::isnan<RealType>)(cyl_bessel_j_zero(std::numeric_limits<RealType>::infinity(), 1, ignore_all_policy())) );
   }
 
   // Tests of cyc_neumann zero function (BesselYZero in Wolfram) for spot values.
@@ -821,8 +823,8 @@
 
   if (std::numeric_limits<RealType>::has_quiet_NaN)
   { // If ignore errors, return NaN.
- BOOST_CHECK(boost::math::isnan(airy_ai_zero<RealType>(0, ignore_all_policy())));
- BOOST_CHECK(boost::math::isnan(airy_ai_zero<RealType>(std::numeric_limits<unsigned>::min() , ignore_all_policy())));
+ BOOST_CHECK((boost::math::isnan)(airy_ai_zero<RealType>(0, ignore_all_policy())));
+ BOOST_CHECK((boost::math::isnan)(airy_ai_zero<RealType>((std::numeric_limits<unsigned>::min)() , ignore_all_policy())));
     // Can't abuse with NaN as won't compile.
     //BOOST_CHECK_THROW(airy_ai_zero<RealType>(std::numeric_limits<RealType>::quiet_NaN()), std::domain_error);
   }
@@ -885,8 +887,8 @@
 
   if (std::numeric_limits<RealType>::has_quiet_NaN)
   { // return NaN.
- BOOST_CHECK(boost::math::isnan(airy_bi_zero<RealType>(0, ignore_all_policy())));
- BOOST_CHECK(boost::math::isnan(airy_bi_zero<RealType>(std::numeric_limits<unsigned>::min() , ignore_all_policy())));
+ BOOST_CHECK((boost::math::isnan)(airy_bi_zero<RealType>(0, ignore_all_policy())));
+ BOOST_CHECK((boost::math::isnan)(airy_bi_zero<RealType>((std::numeric_limits<unsigned>::min)() , ignore_all_policy())));
     // Can't abuse with NaN as won't compile.
     // BOOST_CHECK_THROW(airy_bi_zero<RealType>(std::numeric_limits<RealType>::quiet_NaN()), std::domain_error);
     // cannot convert parameter 1 from 'boost::math::concepts::real_concept' to 'unsigned int'.

Modified: trunk/libs/math/test/test_classify.cpp
==============================================================================
--- trunk/libs/math/test/test_classify.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_classify.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -13,6 +13,8 @@
 #include <boost/math/special_functions/fpclassify.hpp>
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
+#include <iostream>
+#include <iomanip>
 
 #ifdef _MSC_VER
 #pragma warning(disable: 4127 4146) // conditional expression is constant

Modified: trunk/libs/math/test/test_error_handling.cpp
==============================================================================
--- trunk/libs/math/test/test_error_handling.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_error_handling.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -67,6 +67,8 @@
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp> // for test_main
 #include <cerrno> // for errno
+#include <iostream>
+#include <iomanip>
 //
 // Define some policies:
 //

Modified: trunk/libs/math/test/test_nc_t.cpp
==============================================================================
--- trunk/libs/math/test/test_nc_t.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_nc_t.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -737,54 +737,53 @@
   if(std::numeric_limits<RealType>::has_quiet_NaN)
   {
   // Mean
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(-nan, 0))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(+nan, 0))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(-1, 0))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(0, 0))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(1, 0))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(2, nan))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_non_central_t(nan, nan))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(-nan, 0))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(+nan, 0))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(-1, 0))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(0, 0))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(1, 0))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(2, nan))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(nan, nan))));
     BOOST_CHECK(boost::math::isfinite(mean(ignore_error_non_central_t(2, 0)))); // OK
 
     // Variance
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(nan, 0))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(1, nan))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(2, nan))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(-1, 0))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(0, 0))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(1, 0))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(static_cast<RealType>(1.7L), 0))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_non_central_t(2, 0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(nan, 0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(1, nan))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(2, nan))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(-1, 0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(0, 0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(1, 0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(static_cast<RealType>(1.7L), 0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(2, 0))));
 
   // Skewness
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(-1, 0))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(0, 0))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(1, 0))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(2, 0))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_non_central_t(3, 0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(-1, 0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(0, 0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(1, 0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(2, 0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(3, 0))));
 
   // Kurtosis
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(-1, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(0, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(1, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(2, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(3, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_non_central_t(4, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(-1, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(0, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(1, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(2, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(3, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(4, 0))));
  
     // Kurtosis excess
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(-1, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(0, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(1, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(2, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(3, 0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(4, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(-1, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(0, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(1, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(2, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(3, 0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(4, 0))));
   } // has_quiet_NaN
-
   BOOST_CHECK(boost::math::isfinite(mean(ignore_error_non_central_t(1 + std::numeric_limits<RealType>::epsilon(), 0))));
   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));
   BOOST_CHECK(boost::math::isfinite(variance(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));

Modified: trunk/libs/math/test/test_nonfinite_io.cpp
==============================================================================
--- trunk/libs/math/test/test_nonfinite_io.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_nonfinite_io.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -30,7 +30,7 @@
 using namespace boost::math;
 using boost::math::signbit;
 using boost::math::changesign;
-using boost::math::isnan;
+using (boost::math::isnan)(;
 
 //------------------------------------------------------------------------------
 // Test nonfinite_num_put and nonfinite_num_get facets by checking

Modified: trunk/libs/math/test/test_owens_t.cpp
==============================================================================
--- trunk/libs/math/test/test_owens_t.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_owens_t.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -212,7 +212,7 @@
       const RealType exph = exp(h);
       const RealType t = boost::math::owens_t(exph, expa);
       RealType t7 = boost::math::owens_t_T7(exph,expa);
- //if(!boost::math::isnormal(t) || !boost::math::isnormal(t7))
+ //if(!(boost::math::isnormal)(t) || !(boost::math::isnormal)(t7))
       // std::cout << "a = " << expa << " h = " << exph << " t = " << t << " t7 = " << t7 << std::endl;
       BOOST_CHECK_CLOSE_FRACTION(t, t7, tolerance);
     }

Modified: trunk/libs/math/test/test_students_t.cpp
==============================================================================
--- trunk/libs/math/test/test_students_t.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_students_t.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -634,45 +634,45 @@
   if(std::numeric_limits<RealType>::has_quiet_NaN)
   {
   // Mean
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_students_t(-1))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_students_t(0))));
- BOOST_CHECK(boost::math::isnan(mean(ignore_error_students_t(1))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(-1))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(0))));
+ BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(1))));
 
     // Variance
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(-1))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(0))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(1))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(static_cast<RealType>(1.7L)))));
- BOOST_CHECK(boost::math::isnan(variance(ignore_error_students_t(2))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(-1))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(0))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(1))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(static_cast<RealType>(1.7L)))));
+ BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(2))));
 
   // Skewness
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(-1))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(0))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(1))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(2))));
- BOOST_CHECK(boost::math::isnan(skewness(ignore_error_students_t(3))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(-1))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(0))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(1))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(2))));
+ BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(3))));
 
   // Kurtosis
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(-1))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(0))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(1))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(2))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(3))));
- BOOST_CHECK(boost::math::isnan(kurtosis(ignore_error_students_t(4))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(-1))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(1))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(2))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(3))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(4))));
  
     // Kurtosis excess
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(-1))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(0))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(1))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(2))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(3))));
- BOOST_CHECK(boost::math::isnan(kurtosis_excess(ignore_error_students_t(4))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(-1))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(0))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(1))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(2))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(static_cast<RealType>(2.0001L)))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(3))));
+ BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(4))));
   } // has_quiet_NaN
 
   BOOST_CHECK(boost::math::isfinite(mean(ignore_error_students_t(1 + std::numeric_limits<RealType>::epsilon()))));

Modified: trunk/libs/math/test/test_triangular.cpp
==============================================================================
--- trunk/libs/math/test/test_triangular.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_triangular.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -495,7 +495,7 @@
   else
   { // real_concept case, does has_infinfity == false, so can't check it throws.
     // cout << std::numeric_limits<RealType>::infinity() << ' '
- // << boost::math::fpclassify(std::numeric_limits<RealType>::infinity()) << endl;
+ // << (boost::math::fpclassify)(std::numeric_limits<RealType>::infinity()) << endl;
     // value of std::numeric_limits<RealType>::infinity() is zero, so FPclassify is zero,
     // so (boost::math::isfinite)(std::numeric_limits<RealType>::infinity()) does not detect infinity.
     // so these tests would never throw.

Modified: trunk/libs/math/test/test_uniform.cpp
==============================================================================
--- trunk/libs/math/test/test_uniform.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/math/test/test_uniform.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -339,7 +339,7 @@
    else
    { // real_concept case, does has_infinfity == false, so can't check it throws.
      // cout << std::numeric_limits<RealType>::infinity() << ' '
- // << boost::math::fpclassify(std::numeric_limits<RealType>::infinity()) << endl;
+ // << (boost::math::fpclassify)(std::numeric_limits<RealType>::infinity()) << endl;
      // value of std::numeric_limits<RealType>::infinity() is zero, so FPclassify is zero,
      // so (boost::math::isfinite)(std::numeric_limits<RealType>::infinity()) does not detect infinity.
      // so these tests would never throw.

Modified: trunk/libs/multiprecision/test/concepts/number_concept_check.cpp
==============================================================================
--- trunk/libs/multiprecision/test/concepts/number_concept_check.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/concepts/number_concept_check.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -16,6 +16,8 @@
 # pragma warning(disable:4503) // decorated name length exceeded, name was truncated
 #endif
 
+#include <libs/math/test/compile_test/poison.hpp>
+
 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) \

Modified: trunk/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp
==============================================================================
--- trunk/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -16,6 +16,8 @@
 # pragma warning(disable:4503) // decorated name length exceeded, name was truncated
 #endif
 
+#include <libs/math/test/compile_test/poison.hpp>
+
 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) \

Modified: trunk/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp
==============================================================================
--- trunk/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -16,6 +16,8 @@
 # pragma warning(disable:4503) // decorated name length exceeded, name was truncated
 #endif
 
+#include <libs/math/test/compile_test/poison.hpp>
+
 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) \

Modified: trunk/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp
==============================================================================
--- trunk/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -16,6 +16,8 @@
 # pragma warning(disable:4503) // decorated name length exceeded, name was truncated
 #endif
 
+#include <libs/math/test/compile_test/poison.hpp>
+
 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) \

Modified: trunk/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp
==============================================================================
--- trunk/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -16,6 +16,8 @@
 # pragma warning(disable:4503) // decorated name length exceeded, name was truncated
 #endif
 
+#include <libs/math/test/compile_test/poison.hpp>
+
 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) \

Modified: trunk/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp
==============================================================================
--- trunk/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -16,6 +16,8 @@
 # pragma warning(disable:4503) // decorated name length exceeded, name was truncated
 #endif
 
+#include <libs/math/test/compile_test/poison.hpp>
+
 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) \

Modified: trunk/libs/multiprecision/test/test_arithmetic.hpp
==============================================================================
--- trunk/libs/multiprecision/test/test_arithmetic.hpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/test_arithmetic.hpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -813,7 +813,7 @@
    {
       if(std::numeric_limits<Real>::has_infinity)
       {
- BOOST_CHECK(boost::math::isinf(Real(20) / 0u));
+ BOOST_CHECK((boost::math::isinf)(Real(20) / 0u));
       }
       else
       {

Modified: trunk/libs/multiprecision/test/test_float_io.cpp
==============================================================================
--- trunk/libs/multiprecision/test/test_float_io.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/test_float_io.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -201,7 +201,7 @@
       T val = std::numeric_limits<T>::quiet_NaN();
       BOOST_CHECK_EQUAL(val.str(), "nan");
       val = static_cast<T>("nan");
- BOOST_CHECK(boost::math::isnan(val));
+ BOOST_CHECK((boost::math::isnan)(val));
    }
 }
 

Modified: trunk/libs/multiprecision/test/test_numeric_limits.cpp
==============================================================================
--- trunk/libs/multiprecision/test/test_numeric_limits.cpp Sun Jun 30 17:01:02 2013 (r84920)
+++ trunk/libs/multiprecision/test/test_numeric_limits.cpp 2013-07-01 11:43:28 EDT (Mon, 01 Jul 2013) (r84921)
@@ -72,12 +72,12 @@
    Number minv, maxv;
    minv = (std::numeric_limits<Number>::min)();
    maxv = (std::numeric_limits<Number>::max)();
- BOOST_CHECK(boost::math::isnormal(minv));
- BOOST_CHECK(boost::math::isnormal(maxv));
- BOOST_CHECK(boost::math::isnormal(log(minv)));
- BOOST_CHECK(boost::math::isnormal(log(maxv)));
- BOOST_CHECK(boost::math::isnormal(sqrt(minv)));
- BOOST_CHECK(boost::math::isnormal(sqrt(maxv)));
+ BOOST_CHECK((boost::math::isnormal)(minv));
+ BOOST_CHECK((boost::math::isnormal)(maxv));
+ BOOST_CHECK((boost::math::isnormal)(log(minv)));
+ BOOST_CHECK((boost::math::isnormal)(log(maxv)));
+ BOOST_CHECK((boost::math::isnormal)(sqrt(minv)));
+ BOOST_CHECK((boost::math::isnormal)(sqrt(maxv)));
 
    if(std::numeric_limits<Number>::is_specialized)
    {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk