Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80328 - in sandbox/big_number: boost/multiprecision boost/multiprecision/detail libs/multiprecision/doc libs/multiprecision/doc/html libs/multiprecision/doc/html/boost_multiprecision libs/multiprecision/doc/html/boost_multiprecision/indexes libs/multiprecision/doc/html/boost_multiprecision/ref libs/multiprecision/test libs/multiprecision/test/coverage
From: john_at_[hidden]
Date: 2012-08-31 07:57:59


Author: johnmaddock
Date: 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
New Revision: 80328
URL: http://svn.boost.org/trac/boost/changeset/80328

Log:
Extra test cases for more complete coverage.
Added test coverage makefile.
Fixed errors from extra test cases.
Rename a few traits.
Added:
   sandbox/big_number/libs/multiprecision/test/coverage/
   sandbox/big_number/libs/multiprecision/test/coverage/Makefile (contents, props changed)
Text files modified:
   sandbox/big_number/boost/multiprecision/cpp_int.hpp | 77 ++++++-
   sandbox/big_number/boost/multiprecision/detail/default_ops.hpp | 7
   sandbox/big_number/boost/multiprecision/detail/integer_ops.hpp | 12
   sandbox/big_number/boost/multiprecision/detail/no_et_ops.hpp | 2
   sandbox/big_number/boost/multiprecision/detail/number_base.hpp | 41 +++
   sandbox/big_number/boost/multiprecision/detail/number_compare.hpp | 48 ++--
   sandbox/big_number/boost/multiprecision/gmp.hpp | 18 +
   sandbox/big_number/boost/multiprecision/number.hpp | 31 --
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html | 4
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html | 12 +
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html | 4
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html | 14 +
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/headers.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html | 18 +
   sandbox/big_number/libs/multiprecision/doc/html/index.html | 2
   sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk | 19 +
   sandbox/big_number/libs/multiprecision/test/Jamfile.v2 | 31 ++
   sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp | 380 ++++++++++++++++++++++++++++++++++++---
   sandbox/big_number/libs/multiprecision/test/test_cpp_int_conv.cpp | 19 ++
   sandbox/big_number/libs/multiprecision/test/test_int_io.cpp | 2
   sandbox/big_number/libs/multiprecision/test/test_rational_io.cpp | 6
   22 files changed, 600 insertions(+), 151 deletions(-)

Modified: sandbox/big_number/boost/multiprecision/cpp_int.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_int.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_int.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -1152,7 +1152,7 @@
    template <unsigned MinBits2, bool Signed2, class Allocator2>
    cpp_int_backend(const cpp_int_backend<MinBits2, Signed2, Allocator2, true>& other,
       typename enable_if_c<
- (sizeof(cpp_int_backend<MinBits2, Signed2, Allocator2, true>::local_limb_type) <= sizeof(typename cpp_int_backend::local_limb_type))
+ (MinBits2 <= MinBits)
          && (Signed || !Signed2)
>::type* = 0)
       : base_type()
@@ -1168,7 +1168,7 @@
    template <unsigned MinBits2, bool Signed2, class Allocator2>
    explicit cpp_int_backend(const cpp_int_backend<MinBits2, Signed2, Allocator2, true>& other,
       typename disable_if_c<
- (sizeof(cpp_int_backend<MinBits2, Signed2, Allocator2, true>::local_limb_type) <= sizeof(typename cpp_int_backend::local_limb_type))
+ (MinBits2 <= MinBits)
          && (Signed || !Signed2)
>::type* = 0)
       : base_type()
@@ -1209,17 +1209,6 @@
       this->sign(other.sign());
    }
 
- cpp_int_backend& operator = (const char* s)
- {
- try{
- *this->limbs() = boost::lexical_cast<limb_type>(s);
- }
- catch(const std::exception&)
- {
- BOOST_THROW_EXCEPTION(std::runtime_error(std::string("Could not interpret the string \"") + s + std::string("\" as a valid integer value.")));
- }
- return *this;
- }
    BOOST_FORCEINLINE void swap(cpp_int_backend& o) BOOST_NOEXCEPT
    {
       this->do_swap(o);
@@ -1228,11 +1217,13 @@
    std::string str(std::ios_base::fmtflags f, const mpl::false_&)const
    {
       std::stringstream ss;
- ss.flags(f);
+ ss.flags(f & ~std::ios_base::showpos);
       ss << *this->limbs();
       std::string result;
       if(this->sign())
          result += '-';
+ else if(f & std::ios_base::showpos)
+ result += '+';
       result += ss.str();
       return result;
    }
@@ -1314,6 +1305,58 @@
       return result;
    }
 public:
+ cpp_int_backend& operator = (const char* s)
+ {
+ std::size_t n = s ? std::strlen(s) : 0;
+ *this->limbs() = 0;
+ unsigned radix = 10;
+ bool isneg = false;
+ if(n && (*s == '-'))
+ {
+ --n;
+ ++s;
+ isneg = true;
+ }
+ if(n && (*s == '0'))
+ {
+ if((n > 1) && ((s[1] == 'x') || (s[1] == 'X')))
+ {
+ radix = 16;
+ s +=2;
+ n -= 2;
+ }
+ else
+ {
+ radix = 8;
+ n -= 1;
+ }
+ }
+ if(n)
+ {
+ unsigned val;
+ while(*s)
+ {
+ if(*s >= '0' && *s <= '9')
+ val = *s - '0';
+ else if(*s >= 'a' && *s <= 'f')
+ val = 10 + *s - 'a';
+ else if(*s >= 'A' && *s <= 'F')
+ val = 10 + *s - 'A';
+ else
+ val = radix + 1;
+ if(val > radix)
+ {
+ BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected content found while parsing character string."));
+ }
+ *this->limbs() *= radix;
+ *this->limbs() += val;
+ ++s;
+ }
+ }
+ if(isneg)
+ this->negate();
+ return *this;
+ }
    std::string str(std::streamsize /*digits*/, std::ios_base::fmtflags f)const
    {
 #ifdef BOOST_MP_NO_DOUBLE_LIMB_TYPE_IO
@@ -3045,9 +3088,9 @@
       return number_type(0);
    }
    static number_type lowest() BOOST_NOEXCEPT { return (min)(); }
- BOOST_STATIC_CONSTEXPR int digits = 0;
- BOOST_STATIC_CONSTEXPR int digits10 = 0;
- BOOST_STATIC_CONSTEXPR int max_digits10 = 0;
+ BOOST_STATIC_CONSTEXPR int digits = INT_MAX;
+ BOOST_STATIC_CONSTEXPR int digits10 = (INT_MAX / 1000) * 301L;
+ BOOST_STATIC_CONSTEXPR int max_digits10 = digits10 + 2;
    BOOST_STATIC_CONSTEXPR bool is_signed = true;
    BOOST_STATIC_CONSTEXPR bool is_integer = true;
    BOOST_STATIC_CONSTEXPR bool is_exact = true;

Modified: sandbox/big_number/boost/multiprecision/detail/default_ops.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/default_ops.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/default_ops.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -174,13 +174,6 @@
    eval_complement(result, t);
 }
 
-template <class T>
-inline bool is_same_object(const T& u, const T&v) BOOST_NOEXCEPT
-{ return &u == &v; }
-template <class T, class U>
-BOOST_CONSTEXPR inline bool is_same_object(const T&, const U&) BOOST_NOEXCEPT
-{ return false; }
-
 //
 // Default versions of 3-arg arithmetic functions, these mostly just forward to the 2 arg versions:
 //

Modified: sandbox/big_number/boost/multiprecision/detail/integer_ops.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/integer_ops.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/integer_ops.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -401,17 +401,17 @@
    mpl::and_<
       mpl::bool_<number_category<T>::value == number_kind_integer>,
       mpl::or_<
- is_mp_number<T>,
- is_mp_number_expression<T>
+ is_number<T>,
+ is_number_expression<T>
>,
       mpl::or_<
- is_mp_number<U>,
- is_mp_number_expression<U>,
+ is_number<U>,
+ is_number_expression<U>,
          is_integral<U>
>,
       mpl::or_<
- is_mp_number<V>,
- is_mp_number_expression<V>,
+ is_number<V>,
+ is_number_expression<V>,
          is_integral<V>
>
>,

Modified: sandbox/big_number/boost/multiprecision/detail/no_et_ops.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/no_et_ops.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/no_et_ops.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -285,6 +285,7 @@
 {
    number<B, false> result(a);
    using default_ops::eval_left_shift;
+ detail::check_shift_range(b, mpl::bool_<(sizeof(I) > sizeof(std::size_t))>(), is_signed<I>());
    eval_left_shift(result.backend(), b);
    return BOOST_MP_MOVE(result);
 }
@@ -294,6 +295,7 @@
 {
    number<B, false> result(a);
    using default_ops::eval_right_shift;
+ detail::check_shift_range(b, mpl::bool_<(sizeof(I) > sizeof(std::size_t))>(), is_signed<I>());
    eval_right_shift(result.backend(), b);
    return BOOST_MP_MOVE(result);
 }

Modified: sandbox/big_number/boost/multiprecision/detail/number_base.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/number_base.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/number_base.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -18,10 +18,10 @@
 class number;
 
 template <class T>
-struct is_mp_number : public mpl::false_ {};
+struct is_number : public mpl::false_ {};
 
 template <class Backend, bool ExpressionTemplates>
-struct is_mp_number<number<Backend, ExpressionTemplates> > : public mpl::true_ {};
+struct is_number<number<Backend, ExpressionTemplates> > : public mpl::true_ {};
 
 namespace detail{
 
@@ -32,17 +32,17 @@
 } // namespace detail
 
 template <class T>
-struct is_mp_number_expression : public mpl::false_ {};
+struct is_number_expression : public mpl::false_ {};
 
 template<class tag, class Arg1, class Arg2, class Arg3, class Arg4>
-struct is_mp_number_expression<detail::expression<tag, Arg1, Arg2, Arg3, Arg4> > : public mpl::true_ {};
+struct is_number_expression<detail::expression<tag, Arg1, Arg2, Arg3, Arg4> > : public mpl::true_ {};
 
 template <class T, class Num>
 struct is_compatible_arithmetic_type
    : public mpl::bool_<
          is_convertible<T, Num>::value
- && !is_mp_number<T>::value
- && !is_mp_number_expression<T>::value>
+ && !is_number<T>::value
+ && !is_number_expression<T>::value>
 {};
 
 namespace detail{
@@ -192,9 +192,9 @@
 
 
 template <class T>
-struct is_mp_number : public mpl::false_{};
+struct is_number : public mpl::false_{};
 template <class T, bool ExpressionTemplates>
-struct is_mp_number<boost::multiprecision::number<T, ExpressionTemplates> > : public mpl::true_{};
+struct is_number<boost::multiprecision::number<T, ExpressionTemplates> > : public mpl::true_{};
 template <class T>
 struct is_mp_number_exp : public mpl::false_{};
 template <class Tag, class Arg1, class Arg2, class Arg3, class Arg4>
@@ -594,6 +594,29 @@
       str.insert(0, 1, '+');
 }
 
+template <class V>
+void check_shift_range(V val, const mpl::true_&, const mpl::true_&)
+{
+ if(val > (std::numeric_limits<std::size_t>::max)())
+ BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a value greater than std::numeric_limits<std::size_t>::max()."));
+ if(val < 0)
+ BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a negative value."));
+}
+template <class V>
+void check_shift_range(V val, const mpl::false_&, const mpl::true_&)
+{
+ if(val < 0)
+ BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a negative value."));
+}
+template <class V>
+void check_shift_range(V val, const mpl::true_&, const mpl::false_&)
+{
+ if(val > (std::numeric_limits<std::size_t>::max)())
+ BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a value greater than std::numeric_limits<std::size_t>::max()."));
+}
+template <class V>
+void check_shift_range(V, const mpl::false_&, const mpl::false_&) BOOST_NOEXCEPT{}
+
 } // namespace detail
 
 //
@@ -701,7 +724,7 @@
 inline typename enable_if<is_compatible_arithmetic_type<V, number<B, true> >, detail::expression<detail::subtract_immediates, V, number<B, true> > >::type
    operator + (const V& a, const detail::expression<detail::negate, number<B, true> >& b)
 {
- return detail::expression<detail::subtract_immediates, number<B, true>, number<B, true> >(a, b.left_ref());
+ return detail::expression<detail::subtract_immediates, V, number<B, true> >(a, b.left_ref());
 }
 template <class B>
 inline detail::expression<detail::negate, detail::expression<detail::add_immediates, number<B, true>, number<B, true> > >

Modified: sandbox/big_number/boost/multiprecision/detail/number_compare.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/number_compare.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/number_compare.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -74,7 +74,7 @@
    return eval_eq(a.backend(), b.backend());
 }
 template <class Backend, bool ExpressionTemplates, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator == (const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -90,7 +90,7 @@
    return eval_eq(a.backend(), t.backend());
 }
 template <class Arithmetic, class Backend, bool ExpressionTemplates>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator == (const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -98,7 +98,7 @@
    return eval_eq(b.backend(), ct(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator == (const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -116,7 +116,7 @@
    return eval_eq(t.backend(), b.backend());
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator == (const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -142,7 +142,7 @@
    return !eval_eq(a.backend(), b.backend());
 }
 template <class Backend, bool ExpressionTemplates, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator != (const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -158,7 +158,7 @@
    return !eval_eq(a.backend(), t.backend());
 }
 template <class Arithmetic, class Backend, bool ExpressionTemplates>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator != (const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -166,7 +166,7 @@
    return !eval_eq(b.backend(), ct(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator != (const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -184,7 +184,7 @@
    return !eval_eq(t.backend(), b.backend());
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator != (const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -210,7 +210,7 @@
    return eval_lt(a.backend(), b.backend());
 }
 template <class Backend, bool ExpressionTemplates, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator < (const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -226,7 +226,7 @@
    return eval_lt(a.backend(), t.backend());
 }
 template <class Arithmetic, class Backend, bool ExpressionTemplates>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator < (const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -234,7 +234,7 @@
    return eval_gt(b.backend(), ct(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator < (const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -252,7 +252,7 @@
    return eval_lt(t.backend(), b.backend());
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator < (const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -278,7 +278,7 @@
    return eval_gt(a.backend(), b.backend());
 }
 template <class Backend, bool ExpressionTemplates, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator > (const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -294,7 +294,7 @@
    return eval_gt(a.backend(), t.backend());
 }
 template <class Arithmetic, class Backend, bool ExpressionTemplates>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator > (const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -302,7 +302,7 @@
    return eval_lt(b.backend(), ct(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator > (const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -320,7 +320,7 @@
    return eval_gt(t.backend(), b.backend());
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator > (const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -346,7 +346,7 @@
    return !eval_gt(a.backend(), b.backend());
 }
 template <class Backend, bool ExpressionTemplates, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator <= (const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -362,7 +362,7 @@
    return !eval_gt(a.backend(), t.backend());
 }
 template <class Arithmetic, class Backend, bool ExpressionTemplates>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator <= (const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -370,7 +370,7 @@
    return !eval_lt(b.backend(), ct(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator <= (const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -388,7 +388,7 @@
    return !eval_gt(t.backend(), b.backend());
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator <= (const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -414,7 +414,7 @@
    return !eval_lt(a.backend(), b.backend());
 }
 template <class Backend, bool ExpressionTemplates, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator >= (const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -430,7 +430,7 @@
    return !eval_lt(a.backend(), t.backend());
 }
 template <class Arithmetic, class Backend, bool ExpressionTemplates>
-inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, number<Backend, ExpressionTemplates> >::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator >= (const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    typedef typename detail::canonical<Arithmetic, Backend>::type ct;
@@ -438,7 +438,7 @@
    return !eval_gt(b.backend(), ct(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator >= (const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
@@ -456,7 +456,7 @@
    return !eval_lt(t.backend(), b.backend());
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_mp_number_expression<Arithmetic>::value && !is_mp_number<Arithmetic>::value), bool>::type
+inline typename enable_if_c<(is_convertible<Arithmetic, typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value && !is_number_expression<Arithmetic>::value && !is_number<Arithmetic>::value), bool>::type
    operator >= (const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
    typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;

Modified: sandbox/big_number/boost/multiprecision/gmp.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/gmp.hpp (original)
+++ sandbox/big_number/boost/multiprecision/gmp.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -1534,19 +1534,23 @@
 {
    mpz_lcm(result.data(), a.data(), b.data());
 }
-inline void eval_gcd(gmp_int& result, const gmp_int& a, const unsigned long b)
+template <class I>
+inline typename enable_if_c<(is_unsigned<I>::value && (sizeof(I) <= sizeof(unsigned long)))>::type eval_gcd(gmp_int& result, const gmp_int& a, const I b)
 {
    mpz_gcd_ui(result.data(), a.data(), b);
 }
-inline void eval_lcm(gmp_int& result, const gmp_int& a, const unsigned long b)
+template <class I>
+inline typename enable_if_c<(is_unsigned<I>::value && (sizeof(I) <= sizeof(unsigned long)))>::type eval_lcm(gmp_int& result, const gmp_int& a, const I b)
 {
    mpz_lcm_ui(result.data(), a.data(), b);
 }
-inline void eval_gcd(gmp_int& result, const gmp_int& a, const long b)
+template <class I>
+inline typename enable_if_c<(is_signed<I>::value && (sizeof(I) <= sizeof(long)))>::type eval_gcd(gmp_int& result, const gmp_int& a, const I b)
 {
    mpz_gcd_ui(result.data(), a.data(), std::abs(b));
 }
-inline void eval_lcm(gmp_int& result, const gmp_int& a, const long b)
+template <class I>
+inline typename enable_if_c<is_signed<I>::value && ((sizeof(I) <= sizeof(long)))>::type eval_lcm(gmp_int& result, const gmp_int& a, const I b)
 {
    mpz_lcm_ui(result.data(), a.data(), std::abs(b));
 }
@@ -2464,9 +2468,9 @@
    }
    static number_type lowest() BOOST_NOEXCEPT { return (min)(); }
    // Digits are unbounded, use zero for now:
- BOOST_STATIC_CONSTEXPR int digits = 0;
- BOOST_STATIC_CONSTEXPR int digits10 = 0;
- BOOST_STATIC_CONSTEXPR int max_digits10 = 0;
+ BOOST_STATIC_CONSTEXPR int digits = INT_MAX;
+ BOOST_STATIC_CONSTEXPR int digits10 = (INT_MAX / 1000) * 301L;
+ BOOST_STATIC_CONSTEXPR int max_digits10 = digits10 + 2;
    BOOST_STATIC_CONSTEXPR bool is_signed = true;
    BOOST_STATIC_CONSTEXPR bool is_integer = false;
    BOOST_STATIC_CONSTEXPR bool is_exact = true;

Modified: sandbox/big_number/boost/multiprecision/number.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/number.hpp (original)
+++ sandbox/big_number/boost/multiprecision/number.hpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -356,7 +356,7 @@
    BOOST_FORCEINLINE typename enable_if<is_integral<V>, number&>::type operator <<= (V val)
    {
       BOOST_STATIC_ASSERT_MSG(number_category<Backend>::value == number_kind_integer, "The left-shift operation is only valid for integer types");
- check_shift_range(val, mpl::bool_<(sizeof(V) > sizeof(std::size_t))>(), is_signed<V>());
+ detail::check_shift_range(val, mpl::bool_<(sizeof(V) > sizeof(std::size_t))>(), is_signed<V>());
       eval_left_shift(m_backend, canonical_value(val));
       return *this;
    }
@@ -365,7 +365,7 @@
    BOOST_FORCEINLINE typename enable_if<is_integral<V>, number&>::type operator >>= (V val)
    {
       BOOST_STATIC_ASSERT_MSG(number_category<Backend>::value == number_kind_integer, "The right-shift operation is only valid for integer types");
- check_shift_range(val, mpl::bool_<(sizeof(V) > sizeof(std::size_t))>(), is_signed<V>());
+ detail::check_shift_range(val, mpl::bool_<(sizeof(V) > sizeof(std::size_t))>(), is_signed<V>());
       eval_right_shift(m_backend, canonical_value(val));
       return *this;
    }
@@ -639,29 +639,6 @@
    }
 
 
- template <class V>
- void check_shift_range(V val, const mpl::true_&, const mpl::true_&)
- {
- if(val > (std::numeric_limits<std::size_t>::max)())
- BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a value greater than std::numeric_limits<std::size_t>::max()."));
- if(val < 0)
- BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a negative value."));
- }
- template <class V>
- void check_shift_range(V val, const mpl::false_&, const mpl::true_&)
- {
- if(val < 0)
- BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a negative value."));
- }
- template <class V>
- void check_shift_range(V val, const mpl::true_&, const mpl::false_&)
- {
- if(val > (std::numeric_limits<std::size_t>::max)())
- BOOST_THROW_EXCEPTION(std::out_of_range("Can not shift by a value greater than std::numeric_limits<std::size_t>::max()."));
- }
- template <class V>
- void check_shift_range(V, const mpl::false_&, const mpl::false_&) BOOST_NOEXCEPT{}
-
    template <class Exp>
    void do_assign(const Exp& e, const detail::add_immediates&)
    {
@@ -1072,6 +1049,7 @@
    {
       BOOST_STATIC_ASSERT_MSG(number_category<Backend>::value == number_kind_integer, "The right shift operation is only valid for integer types");
       using default_ops::eval_right_shift;
+ detail::check_shift_range(val, mpl::bool_<(sizeof(Val) > sizeof(std::size_t))>(), is_signed<Val>());
       eval_right_shift(m_backend, canonical_value(e.value()), val);
    }
 
@@ -1080,6 +1058,7 @@
    {
       BOOST_STATIC_ASSERT_MSG(number_category<Backend>::value == number_kind_integer, "The left shift operation is only valid for integer types");
       using default_ops::eval_left_shift;
+ detail::check_shift_range(val, mpl::bool_<(sizeof(Val) > sizeof(std::size_t))>(), is_signed<Val>());
       eval_left_shift(m_backend, canonical_value(e.value()), val);
    }
 
@@ -1089,6 +1068,7 @@
       BOOST_STATIC_ASSERT_MSG(number_category<Backend>::value == number_kind_integer, "The right shift operation is only valid for integer types");
       using default_ops::eval_right_shift;
       self_type temp(e);
+ detail::check_shift_range(val, mpl::bool_<(sizeof(Val) > sizeof(std::size_t))>(), is_signed<Val>());
       eval_right_shift(m_backend, temp.backend(), val);
    }
 
@@ -1098,6 +1078,7 @@
       BOOST_STATIC_ASSERT_MSG(number_category<Backend>::value == number_kind_integer, "The left shift operation is only valid for integer types");
       using default_ops::eval_left_shift;
       self_type temp(e);
+ detail::check_shift_range(val, mpl::bool_<(sizeof(Val) > sizeof(std::size_t))>(), is_signed<Val>());
       eval_left_shift(m_backend, temp.backend(), val);
    }
 

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -13,9 +13,9 @@
 <div class="spirit-nav">
 <a accesskey="p" href="../indexes.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s02.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section id973004">
+<div class="section id952470">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="id973004"></a>Function Index</h3></div></div></div>
+<a name="id952470"></a>Function Index</h3></div></div></div>
 <p><a class="link" href="s01.html#idx_id_0">A</a> <a class="link" href="s01.html#idx_id_1">B</a> <a class="link" href="s01.html#idx_id_2">C</a> <a class="link" href="s01.html#idx_id_3">D</a> <a class="link" href="s01.html#idx_id_4">E</a> <a class="link" href="s01.html#idx_id_5">F</a> <a class="link" href="s01.html#idx_id_7">I</a> <a class="link" href="s01.html#idx_id_8">L</a> <a class="link" href="s01.html#idx_id_9">M</a> <a class="link" href="s01.html#idx_id_12">P</a> <a class="link" href="s01.html#idx_id_13">R</a> <a class="link" href="s01.html#idx_id_14">S</a> <a class="link" href="s01.html#idx_id_15">T</a> <a class="link" href="s01.html#idx_id_17">Z</a></p>
 <div class="variablelist"><dl class="variablelist">
 <dt>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -13,9 +13,9 @@
 <div class="spirit-nav">
 <a accesskey="p" href="s01.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s03.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section id975420">
+<div class="section id954901">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="id975420"></a>Class Index</h3></div></div></div>
+<a name="id954901"></a>Class Index</h3></div></div></div>
 <p><a class="link" href="s02.html#idx_id_20">C</a> <a class="link" href="s02.html#idx_id_24">G</a> <a class="link" href="s02.html#idx_id_25">I</a> <a class="link" href="s02.html#idx_id_27">M</a> <a class="link" href="s02.html#idx_id_28">N</a> <a class="link" href="s02.html#idx_id_33">T</a></p>
 <div class="variablelist"><dl class="variablelist">
 <dt>
@@ -53,6 +53,14 @@
 <div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/internals.html" title="Internal Support Code"><span class="index-entry-level-1">Internal Support Code</span></a></p></li></ul></div>
 </li>
 <li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">is_number</span></p>
+<div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">number</span></a></p></li></ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">is_number_expression</span></p>
+<div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">number</span></a></p></li></ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
 <p><span class="index-entry-level-0">is_restricted_conversion</span></p>
 <div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/internals.html" title="Internal Support Code"><span class="index-entry-level-1">Internal Support Code</span></a></p></li></ul></div>
 </li>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -13,9 +13,9 @@
 <div class="spirit-nav">
 <a accesskey="p" href="s02.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s04.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section id975726">
+<div class="section id955245">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="id975726"></a>Typedef Index</h3></div></div></div>
+<a name="id955245"></a>Typedef Index</h3></div></div></div>
 <p><a class="link" href="s03.html#idx_id_38">C</a> <a class="link" href="s03.html#idx_id_43">I</a> <a class="link" href="s03.html#idx_id_44">L</a> <a class="link" href="s03.html#idx_id_45">M</a> <a class="link" href="s03.html#idx_id_51">T</a> <a class="link" href="s03.html#idx_id_52">U</a></p>
 <div class="variablelist"><dl class="variablelist">
 <dt>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -12,9 +12,9 @@
 <div class="spirit-nav">
 <a accesskey="p" href="s03.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a>
 </div>
-<div class="section id979191">
+<div class="section id958711">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="id979191"></a>Index</h3></div></div></div>
+<a name="id958711"></a>Index</h3></div></div></div>
 <p><a class="link" href="s04.html#idx_id_54">A</a> <a class="link" href="s04.html#idx_id_55">B</a> <a class="link" href="s04.html#idx_id_56">C</a> <a class="link" href="s04.html#idx_id_57">D</a> <a class="link" href="s04.html#idx_id_58">E</a> <a class="link" href="s04.html#idx_id_59">F</a> <a class="link" href="s04.html#idx_id_60">G</a> <a class="link" href="s04.html#idx_id_61">I</a> <a class="link" href="s04.html#idx_id_62">L</a> <a class="link" href="s04.html#idx_id_63">M</a> <a class="link" href="s04.html#idx_id_64">N</a> <a class="link" href="s04.html#idx_id_65">O</a> <a class="link" href="s04.html#idx_id_66">P</a> <a class="link" href="s04.html#idx_id_67">R</a> <a class="link" href="s04.html#idx_id_68">S</a> <a class="link" href="s04.html#idx_id_69">T</a> <a class="link" href="s04.html#idx_id_70">U</a> <a class="link" href="s04.html#idx_id_71">Z</a></p>
 <div class="variablelist"><dl class="variablelist">
 <dt>
@@ -516,6 +516,14 @@
 <div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/internals.html" title="Internal Support Code"><span class="index-entry-level-1">Internal Support Code</span></a></p></li></ul></div>
 </li>
 <li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">is_number</span></p>
+<div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">number</span></a></p></li></ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">is_number_expression</span></p>
+<div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">number</span></a></p></li></ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
 <p><span class="index-entry-level-0">is_restricted_conversion</span></p>
 <div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/internals.html" title="Internal Support Code"><span class="index-entry-level-1">Internal Support Code</span></a></p></li></ul></div>
 </li>
@@ -674,6 +682,8 @@
 <li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">isinf</span></a></p></li>
 <li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">isnan</span></a></p></li>
 <li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">isnormal</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">is_number</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">is_number_expression</span></a></p></li>
 <li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">itrunc</span></a></p></li>
 <li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">llround</span></a></p></li>
 <li class="listitem" style="list-style-type: none"><p><a class="link" href="../ref/number.html" title="number"><span class="index-entry-level-1">lltrunc</span></a></p></li>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -256,7 +256,7 @@
       Will very likely result in obscure error messages inside the body of <code class="computeroutput"><span class="identifier">my_proc</span></code> - since we've passed it an expression
       template type, and not a number type. Instead we probably need:
     </p>
-<pre class="programlisting"><span class="identifier">my_proc</span><span class="special">(</span><span class="identifier">my_mp_number_type</span><span class="special">(</span><span class="identifier">a</span><span class="special">+</span><span class="identifier">b</span><span class="special">));</span>
+<pre class="programlisting"><span class="identifier">my_proc</span><span class="special">(</span><span class="identifier">my_number_type</span><span class="special">(</span><span class="identifier">a</span><span class="special">+</span><span class="identifier">b</span><span class="special">));</span>
 </pre>
 <p>
       Having said that, these situations don't occur that often - or indeed not at

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/headers.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/headers.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/headers.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -166,7 +166,7 @@
 <tr>
 <td>
                 <p>
- concepts/mp_number_archetypes.hpp
+ concepts/number_archetypes.hpp
                 </p>
               </td>
 <td>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -148,6 +148,10 @@
 <span class="keyword">struct</span> <span class="identifier">component_type</span><span class="special">;</span>
 <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
 <span class="keyword">struct</span> <span class="identifier">number_category</span><span class="special">;</span>
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">is_number</span><span class="special">;</span>
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">is_number_expression</span><span class="special">;</span>
 
 <span class="comment">// Integer specific functions:</span>
 <span class="emphasis"><em>unmentionable-expression-template-type</em></span> <span class="identifier">pow</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>number-or-expression-template-type</em></span><span class="special">&amp;,</span> <span class="keyword">unsigned</span><span class="special">);</span>
@@ -630,6 +634,20 @@
         for generic code that must work with built in arithmetic types as well as
         multiprecision ones.
       </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">is_number</span><span class="special">;</span>
+</pre>
+<p>
+ A traits class that inherits from <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
+ if T is an instance of <code class="computeroutput"><span class="identifier">number</span><span class="special">&lt;&gt;</span></code>, otherwise from <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">is_number_expression</span><span class="special">;</span>
+</pre>
+<p>
+ A traits class that inherits from <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
+ if T is an expression template type derived from <code class="computeroutput"><span class="identifier">number</span><span class="special">&lt;&gt;</span></code>, otherwise from <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></code>.
+ </p>
 <h5>
 <a name="boost_multiprecision.ref.number.h7"></a>
         <span class="phrase"><a name="boost_multiprecision.ref.number.integer_functions"></a></span><a class="link" href="number.html#boost_multiprecision.ref.number.integer_functions">Integer

Modified: sandbox/big_number/libs/multiprecision/doc/html/index.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/index.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/index.html 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -120,7 +120,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: August 27, 2012 at 12:20:10 GMT</small></p></td>
+<td align="left"><p><small>Last revised: August 30, 2012 at 17:55:33 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk (original)
+++ sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -223,7 +223,7 @@
 Will very likely result in obscure error messages inside the body of `my_proc` - since we've passed it
 an expression template type, and not a number type. Instead we probably need:
 
- my_proc(my_mp_number_type(a+b));
+ my_proc(my_number_type(a+b));
 
 Having said that, these situations don't occur that often - or indeed not at all for non-template functions.
 In addition, all the functions in the Boost.Math library will automatically convert expression-template arguments
@@ -1188,6 +1188,10 @@
    struct component_type;
    template <class T>
    struct number_category;
+ template <class T>
+ struct is_number;
+ template <class T>
+ struct is_number_expression;
 
    // Integer specific functions:
    ``['unmentionable-expression-template-type]`` pow(const ``['number-or-expression-template-type]``&, unsigned);
@@ -1512,6 +1516,17 @@
 `std::numeric_limits` support as well as for classes in this library: which means it can be used for generic code that must work
 with built in arithmetic types as well as multiprecision ones.
 
+ template <class T>
+ struct is_number;
+
+A traits class that inherits from `mpl::true_` if T is an instance of `number<>`, otherwise from `mpl::false_`.
+
+ template <class T>
+ struct is_number_expression;
+
+A traits class that inherits from `mpl::true_` if T is an expression template type derived from `number<>`, otherwise from `mpl::false_`.
+
+
 
 [h4 Integer functions]
 
@@ -2196,7 +2211,7 @@
 [[rational_adapter.hpp][Defines the `rational_adapter` backend.]]
 [[cpp_dec_float.hpp][Defines the `cpp_dec_float` backend.]]
 [[tommath.hpp][Defines the `tommath_int` backend.]]
-[[concepts/mp_number_archetypes.hpp][Defines a backend concept architypes for testing use.]]
+[[concepts/number_archetypes.hpp][Defines a backend concept architypes for testing use.]]
 ]
 
 [table Implementation Headers]

Modified: sandbox/big_number/libs/multiprecision/test/Jamfile.v2
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/Jamfile.v2 (original)
+++ sandbox/big_number/libs/multiprecision/test/Jamfile.v2 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -135,8 +135,22 @@
         : # command line
         : # input files
         : # requirements
- <define>TEST_CPP_INT
- : test_arithmetic_cpp_int ;
+ <define>TEST_CPP_INT_1
+ : test_arithmetic_cpp_int_1 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_2
+ : test_arithmetic_cpp_int_2 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_3
+ : test_arithmetic_cpp_int_3 ;
 
 run test_arithmetic.cpp
         : # command line
@@ -805,8 +819,8 @@
 {
    compile-fail $(source)
    :
- [ check-target-builds ../config//has_gmp : <define>TEST_GMP : ]
- [ check-target-builds ../config//has_mpfr : <define>TEST_MPFR : ]
+ [ check-target-builds ../config//has_gmp : <define>TEST_GMP <debug-symbols>off : ]
+ [ check-target-builds ../config//has_mpfr : <define>TEST_MPFR <debug-symbols>off : ]
    ;
 }
 
@@ -820,51 +834,60 @@
               : # requirements
                     <define>TEST_MPFR_50
                [ check-target-builds ../config//has_mpfr : : <build>no ]
+ <debug-symbols>off
               : $(source:B)_mpfr_50 ;
 
       compile $(source) mpfr
               : # requirements
                     <define>TEST_MPFR_6
                [ check-target-builds ../config//has_mpfr : : <build>no ]
+ <debug-symbols>off
               : $(source:B)_mpfr_6 ;
 
       compile $(source) mpfr
               : # requirements
                     <define>TEST_MPFR_15
                [ check-target-builds ../config//has_mpfr : : <build>no ]
+ <debug-symbols>off
               : $(source:B)_mpfr_15 ;
 
       compile $(source) mpfr
               : # requirements
                     <define>TEST_MPFR_17
                [ check-target-builds ../config//has_mpfr : : <build>no ]
+ <debug-symbols>off
               : $(source:B)_mpfr_17 ;
 
       compile $(source) mpfr
               : # requirements
                     <define>TEST_MPFR_30
                [ check-target-builds ../config//has_mpfr : : <build>no ]
+ <debug-symbols>off
               : $(source:B)_mpfr_30 ;
 
       compile $(source) gmp
               : # requirements
                     <define>TEST_MPF_50
                [ check-target-builds ../config//has_gmp : : <build>no ]
+ <debug-symbols>off
               : $(source:B)_mpf50 ;
 
       compile $(source)
               : # requirements
                     <define>TEST_CPP_DEC_FLOAT
+ <debug-symbols>off
               : $(source:B)_cpp_dec_float ;
 
       compile $(source)
               : # requirements
                     <define>TEST_CPP_DEC_FLOAT_NO_ET
+ <debug-symbols>off
               : $(source:B)_cpp_dec_float_no_et ;
 
       compile $(source)
               : # requirements
                     <define>TEST_BACKEND
+ <debug-symbols>off
               : $(source:B)_backend_concept ;
    }
 }

Added: sandbox/big_number/libs/multiprecision/test/coverage/Makefile
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/coverage/Makefile 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -0,0 +1,173 @@
+# copyright John Maddock 2012
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt.
+
+
+SOURCES=\
+../../../../boost/multiprecision/mpfr.hpp\
+../../../../boost/multiprecision/tommath.hpp\
+../../../../boost/multiprecision/number.hpp\
+../../../../boost/multiprecision/cpp_dec_float.hpp\
+../../../../boost/multiprecision/gmp.hpp\
+../../../../boost/multiprecision/random.hpp\
+../../../../boost/multiprecision/cpp_int.hpp\
+../../../../boost/multiprecision/miller_rabin.hpp\
+../../../../boost/multiprecision/rational_adapter.hpp\
+../../../../boost/multiprecision/concepts/mp_number_archetypes.hpp\
+../../../../boost/multiprecision/detail/big_lanczos.hpp\
+../../../../boost/multiprecision/detail/digits.hpp\
+../../../../boost/multiprecision/detail/no_et_ops.hpp\
+../../../../boost/multiprecision/detail/cpp_int_core.hpp\
+../../../../boost/multiprecision/detail/number_base.hpp\
+../../../../boost/multiprecision/detail/cpp_int_trivial_ops.hpp\
+../../../../boost/multiprecision/detail/generic_interconvert.hpp\
+../../../../boost/multiprecision/detail/number_compare.hpp\
+../../../../boost/multiprecision/detail/default_ops.hpp\
+../../../../boost/multiprecision/detail/integer_ops.hpp\
+../../../../boost/multiprecision/detail/functions/constants.hpp\
+../../../../boost/multiprecision/detail/functions/pow.hpp\
+../../../../boost/multiprecision/detail/functions/trig.hpp\
+../../../../boost/multiprecision/traits/explicit_conversion.hpp\
+../../../../boost/multiprecision/traits/is_restricted_conversion.hpp
+
+coverage : run
+ gcov test_arithmetic_cpp_int_1 test_arithmetic_cpp_int_2 test_arithmetic_cpp_int_3 test_arithmetic_cpp_dec_float test_arithmetic_concept test_arithmetic_mpz test_arithmetic_mpf test_arithmetic_mpf_50 test_arithmetic_mpq test_arithmetic_mpfr test_arithmetic_mpfr_50 test_cpp_int test_int_io test_float_io test_rational_io test_gmp_conversions test_mpfr_conversions test_cpp_int_conv
+
+test_arithmetic_cpp_int_1.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_CPP_INT_1 --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_cpp_int_1.o -c ../test_arithmetic.cpp
+
+test_arithmetic_cpp_int_1 : test_arithmetic_cpp_int_1.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_cpp_int_1 test_arithmetic_cpp_int_1.o
+
+test_arithmetic_cpp_int_2.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_CPP_INT_2 --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_cpp_int_2.o -c ../test_arithmetic.cpp
+
+test_arithmetic_cpp_int_2 : test_arithmetic_cpp_int_2.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_cpp_int_2 test_arithmetic_cpp_int_2.o
+
+test_arithmetic_cpp_int_3.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_CPP_INT_3 --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_cpp_int_3.o -c ../test_arithmetic.cpp
+
+test_arithmetic_cpp_int_3 : test_arithmetic_cpp_int_3.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_cpp_int_3 test_arithmetic_cpp_int_3.o
+
+test_arithmetic_cpp_dec_float.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_CPP_DEC_FLOAT --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_cpp_dec_float.o -c ../test_arithmetic.cpp
+
+test_arithmetic_cpp_dec_float : test_arithmetic_cpp_dec_float.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_cpp_dec_float test_arithmetic_cpp_dec_float.o
+
+test_arithmetic_concept.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_BACKEND --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_concept.o -c ../test_arithmetic.cpp
+
+test_arithmetic_concept : test_arithmetic_concept.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_concept test_arithmetic_concept.o
+
+test_arithmetic_mpz.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_MPZ --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_mpz.o -c ../test_arithmetic.cpp
+
+test_arithmetic_mpz : test_arithmetic_mpz.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_mpz test_arithmetic_mpz.o -lgmp
+
+test_arithmetic_mpf.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_MPF --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_mpf.o -c ../test_arithmetic.cpp
+
+test_arithmetic_mpf : test_arithmetic_mpf.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_mpf test_arithmetic_mpf.o -lgmp
+
+test_arithmetic_mpf_50.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_MPF_50 --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_mpf_50.o -c ../test_arithmetic.cpp
+
+test_arithmetic_mpf_50 : test_arithmetic_mpf_50.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_mpf_50 test_arithmetic_mpf_50.o -lgmp
+
+test_arithmetic_mpq.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_MPQ --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_mpq.o -c ../test_arithmetic.cpp
+
+test_arithmetic_mpq : test_arithmetic_mpq.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_mpq test_arithmetic_mpq.o -lgmp
+
+test_arithmetic_mpfr.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_MPFR --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_mpfr.o -c ../test_arithmetic.cpp
+
+test_arithmetic_mpfr : test_arithmetic_mpfr.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_mpfr test_arithmetic_mpfr.o -lmpfr -lgmp
+
+test_arithmetic_mpfr_50.o : ../test_arithmetic.cpp $(SOURCES)
+ g++ -std=gnu++0x -DTEST_MPFR_50 --coverage -g -I../../../.. -I../../../../../../trunk -o test_arithmetic_mpfr_50.o -c ../test_arithmetic.cpp
+
+test_arithmetic_mpfr_50 : test_arithmetic_mpfr_50.o
+ g++ -std=gnu++0x --coverage -o test_arithmetic_mpfr_50 test_arithmetic_mpfr_50.o -lmpfr -lgmp
+
+test_cpp_int.o : ../test_cpp_int.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -g -I../../../.. -I../../../../../../trunk -o test_cpp_int.o -c ../test_cpp_int.cpp
+
+test_cpp_int : test_cpp_int.o
+ g++ -std=gnu++0x --coverage -o test_cpp_int test_cpp_int.o -lgmp
+
+test_int_io.o : ../test_int_io.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -DTEST_MPZ -DTEST_CPP_INT -g -I../../../.. -I../../../../../../trunk -o test_int_io.o -c ../test_int_io.cpp
+
+test_int_io : test_int_io.o
+ g++ -std=gnu++0x --coverage -o test_int_io test_int_io.o -lgmp
+
+test_float_io.o : ../test_float_io.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -g -I../../../.. -I../../../../../../trunk -o test_float_io.o -c ../test_float_io.cpp
+
+test_float_io : test_float_io.o
+ g++ -std=gnu++0x --coverage -o test_float_io test_float_io.o -lmpfr -lgmp
+
+test_rational_io.o : ../test_rational_io.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -DTEST_MPQ -DTEST_CPP_INT -g -I../../../.. -I../../../../../../trunk -o test_rational_io.o -c ../test_rational_io.cpp
+
+test_rational_io : test_rational_io.o
+ g++ -std=gnu++0x --coverage -o test_rational_io test_rational_io.o -lgmp
+
+test_gmp_conversions.o : ../test_gmp_conversions.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -g -I../../../.. -I../../../../../../trunk -o test_gmp_conversions.o -c ../test_gmp_conversions.cpp
+
+test_gmp_conversions : test_gmp_conversions.o
+ g++ -std=gnu++0x --coverage -o test_gmp_conversions test_gmp_conversions.o -lgmp
+
+test_mpfr_conversions.o : ../test_mpfr_conversions.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -g -I../../../.. -I../../../../../../trunk -o test_mpfr_conversions.o -c ../test_mpfr_conversions.cpp
+
+test_mpfr_conversions : test_mpfr_conversions.o
+ g++ -std=gnu++0x --coverage -o test_mpfr_conversions test_mpfr_conversions.o -lmpfr -lgmp
+
+test_cpp_int_conv.o : ../test_cpp_int_conv.cpp $(SOURCES)
+ g++ -std=gnu++0x --coverage -g -I../../../.. -I../../../../../../trunk -o test_cpp_int_conv.o -c ../test_cpp_int_conv.cpp
+
+test_cpp_int_conv : test_cpp_int_conv.o
+ g++ -std=gnu++0x --coverage -o test_cpp_int_conv test_cpp_int_conv.o
+
+run : test_arithmetic_cpp_int_1 test_arithmetic_cpp_int_2 test_arithmetic_cpp_int_3 test_arithmetic_cpp_dec_float test_arithmetic_concept test_arithmetic_mpz test_arithmetic_mpf test_arithmetic_mpf_50 \
+test_arithmetic_mpq test_arithmetic_mpfr test_arithmetic_mpfr_50 test_cpp_int test_int_io test_float_io test_rational_io test_gmp_conversions test_mpfr_conversions test_cpp_int_conv
+ ./test_arithmetic_cpp_int_1
+ ./test_arithmetic_cpp_int_2
+ ./test_arithmetic_cpp_int_3
+ ./test_arithmetic_cpp_dec_float
+ ./test_arithmetic_concept
+ ./test_arithmetic_mpz
+ ./test_arithmetic_mpf
+ ./test_arithmetic_mpf_50
+ ./test_arithmetic_mpq
+ ./test_arithmetic_mpfr
+ ./test_arithmetic_mpfr_50
+ ./test_cpp_int
+ ./test_int_io
+ ./test_float_io
+ ./test_rational_io
+ ./test_gmp_conversions
+ ./test_mpfr_conversions
+ ./test_cpp_int_conv
+
+clean :
+ rm -rf *.o *.gc* test_arithmetic_cpp_int_1 test_arithmetic_cpp_int_2 test_arithmetic_cpp_int_3 test_arithmetic_cpp_dec_float test_arithmetic_concept test_arithmetic_mpz \
+ test_arithmetic_mpf test_arithmetic_mpf_50 test_arithmetic_mpq test_arithmetic_mpfr test_arithmetic_mpfr_50 test_cpp_int\
+ test_int_io test_float_io test_rational_io test_gmp_conversions test_mpfr_conversions test_cpp_int_conv
+
+
+
+

Modified: sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -18,7 +18,8 @@
 #if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) && \
    !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPQ) \
    && !defined(TEST_TOMMATH) && !defined(TEST_TOMMATH_BOOST_RATIONAL) && !defined(TEST_MPZ_BOOST_RATIONAL)\
- && !defined(TEST_CPP_INT) && !defined(TEST_CPP_INT_BR) && !defined(TEST_ARITHMETIC_BACKEND)
+ && !defined(TEST_CPP_INT_1) && !defined(TEST_CPP_INT_2) && !defined(TEST_CPP_INT_3) \
+ && !defined(TEST_CPP_INT_BR) && !defined(TEST_ARITHMETIC_BACKEND)
 # define TEST_MPF_50
 # define TEST_MPF
 # define TEST_BACKEND
@@ -28,7 +29,9 @@
 # define TEST_CPP_DEC_FLOAT
 # define TEST_MPQ
 # define TEST_TOMMATH
-# define TEST_CPP_INT
+# define TEST_CPP_INT_1
+# define TEST_CPP_INT_2
+# define TEST_CPP_INT_3
 # define TEST_CPP_INT_BR
 # define TEST_ARITHMETIC_BACKEND
 
@@ -61,7 +64,7 @@
 #include <boost/multiprecision/tommath.hpp>
 #include <boost/multiprecision/rational_adapter.hpp>
 #endif
-#if defined(TEST_CPP_INT) || defined(TEST_CPP_INT_BR)
+#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR)
 #include <boost/multiprecision/cpp_int.hpp>
 #endif
 
@@ -142,6 +145,11 @@
 void test_comparisons(Val, Val, const boost::mpl::false_)
 {}
 
+int normalize_compare_result(int r)
+{
+ return r > 0 ? 1 : r < 0 ? -1 : 0;
+}
+
 template <class Real, class Val>
 void test_comparisons(Val a, Val b, const boost::mpl::true_)
 {
@@ -149,6 +157,8 @@
    Real r2(b);
    Real z(1);
 
+ int cr = a < b ? -1 : a > b ? 1 : 0;
+
    BOOST_TEST_EQUAL(r1 == r2, a == b);
    BOOST_TEST_EQUAL(r1 != r2, a != b);
    BOOST_TEST_EQUAL(r1 <= r2, a <= b);
@@ -204,6 +214,35 @@
    BOOST_TEST_EQUAL(a < r2*z, a < b);
    BOOST_TEST_EQUAL(a >= r2*z, a >= b);
    BOOST_TEST_EQUAL(a > r2*z, a > b);
+
+ BOOST_TEST_EQUAL(normalize_compare_result(r1.compare(r2)), cr);
+ BOOST_TEST_EQUAL(normalize_compare_result(r2.compare(r1)), -cr);
+ BOOST_TEST_EQUAL(normalize_compare_result(r1.compare(b)), cr);
+ BOOST_TEST_EQUAL(normalize_compare_result(r2.compare(a)), -cr);
+}
+
+template <class Real, class Exp>
+void test_conditional(Real v, Exp e)
+{
+ //
+ // Verify that Exp is usable in Boolean contexts, and has the same value as v:
+ //
+ if(e)
+ {
+ BOOST_TEST(v);
+ }
+ else
+ {
+ BOOST_TEST(!v);
+ }
+ if(!e)
+ {
+ BOOST_TEST(!v);
+ }
+ else
+ {
+ BOOST_TEST(v);
+ }
 }
 
 template <class Real>
@@ -289,6 +328,15 @@
    BOOST_TEST(a % a == 0);
    BOOST_TEST(a % c == 0);
    BOOST_TEST(a % 5 == 0);
+ a = a % (b + 0);
+ BOOST_TEST(a == 20 % 7);
+ a = 20;
+ c = (a + 2) % (a - 1);
+ BOOST_TEST(c == 22 % 19);
+ c = 5;
+ a = b % (a - 15);
+ BOOST_TEST(a == 7 % 5);
+ a = 20;
    if(std::numeric_limits<Real>::is_signed)
    {
       BOOST_TEST(-a % c == 0);
@@ -326,6 +374,9 @@
       a = -20;
       a %= -b;
       BOOST_TEST(a == -20 % -7);
+ a = 5;
+ a %= b - a;
+ BOOST_TEST(a == 5 % (7-5));
    }
 
    a = 20;
@@ -378,12 +429,35 @@
    BOOST_TEST(a == 2000);
    BOOST_TEST_THROW(a <<= -20, std::out_of_range);
    BOOST_TEST_THROW(a >>= -20, std::out_of_range);
+ BOOST_TEST_THROW(Real(a << -20), std::out_of_range);
+ BOOST_TEST_THROW(Real(a >> -20), std::out_of_range);
 #ifndef BOOST_NO_LONG_LONG
    if(sizeof(long long) > sizeof(std::size_t))
    {
       // extreme values should trigger an exception:
       BOOST_TEST_THROW(a >>= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
       BOOST_TEST_THROW(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_TEST_THROW(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_TEST_THROW(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_TEST_THROW(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_TEST_THROW(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ // Unless they fit within range:
+ a = 2000L;
+ BOOST_TEST((a <<= 20uLL) == (2000L << 20));
+ a = 2000;
+ BOOST_TEST((a <<= 20LL) == (2000L << 20));
+
+ BOOST_TEST_THROW(Real(a >> (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_TEST_THROW(Real(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_TEST_THROW(Real(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_TEST_THROW(Real(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_TEST_THROW(Real(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_TEST_THROW(Real(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ // Unless they fit within range:
+ a = 2000L;
+ BOOST_TEST(Real(a << 20uLL) == (2000L << 20));
+ a = 2000;
+ BOOST_TEST(Real(a << 20LL) == (2000L << 20));
    }
 #endif
    a = 20;
@@ -422,6 +496,11 @@
    a = i;
    c = a & b & k;
    BOOST_TEST(c == (i&j&k));
+ c = a;
+ c &= (c+b);
+ BOOST_TEST(c == (i & (i+j)));
+ c = a & (b | 1);
+ BOOST_TEST(c == (i & (j | 1)));
 
    test_complement<Real>(a, b, c, typename is_twos_complement_integer<Real>::type());
 
@@ -446,6 +525,11 @@
    a = i;
    c = a | b | k;
    BOOST_TEST(c == (i|j|k));
+ c = a;
+ c |= (c + b);
+ BOOST_TEST(c == (i | (i+j)));
+ c = a | (b | 1);
+ BOOST_TEST(c == (i | (j | 1)));
 
    a = i;
    b = j;
@@ -468,6 +552,12 @@
    a = i;
    c = a ^ b ^ k;
    BOOST_TEST(c == (i^j^k));
+ c = a;
+ c ^= (c + b);
+ BOOST_TEST(c == (i ^ (i+j)));
+ c = a ^ (b | 1);
+ BOOST_TEST(c == (i ^ (j | 1)));
+
    a = i;
    b = j;
    c = k;
@@ -480,8 +570,28 @@
    BOOST_TEST(lcm(a, b) == boost::math::lcm(400, 45));
    BOOST_TEST(gcd(a, 45) == boost::math::gcd(400, 45));
    BOOST_TEST(lcm(a, 45) == boost::math::lcm(400, 45));
+ if(std::numeric_limits<Real>::is_signed)
+ {
+ BOOST_TEST(gcd(a, -45) == boost::math::gcd(400, 45));
+ BOOST_TEST(lcm(a, -45) == boost::math::lcm(400, 45));
+ }
+ BOOST_TEST(gcd(a, 45u) == boost::math::gcd(400, 45));
+ BOOST_TEST(lcm(a, 45u) == boost::math::lcm(400, 45));
    BOOST_TEST(gcd(400, b) == boost::math::gcd(400, 45));
    BOOST_TEST(lcm(400, b) == boost::math::lcm(400, 45));
+ if(std::numeric_limits<Real>::is_signed)
+ {
+ BOOST_TEST(gcd(-400, b) == boost::math::gcd(400, 45));
+ BOOST_TEST(lcm(-400, b) == boost::math::lcm(400, 45));
+ }
+ BOOST_TEST(gcd(400u, b) == boost::math::gcd(400, 45));
+ BOOST_TEST(lcm(400u, b) == boost::math::lcm(400, 45));
+
+ //
+ // Conditionals involving 2 arg functions:
+ //
+ test_conditional(Real(gcd(a, b)), gcd(a, b));
+
    Real r;
    divide_qr(a, b, c, r);
    BOOST_TEST(c == a / b);
@@ -571,11 +681,47 @@
    BOOST_TEST(powm(Real(3) + 0, 4 + 0, 13) == 81 % 13);
    BOOST_TEST(powm(Real(3) + 0, 4 + 0, Real(13) + 0) == 81 % 13);
    //
+ // Conditionals involving 3 arg functions:
+ //
+ test_conditional(Real(powm(Real(3), Real(4), Real(13))), powm(Real(3), Real(4), Real(13)));
+
+ //
    // Things that are expected errors:
    //
    BOOST_CHECK_THROW(Real("3.14"), std::runtime_error);
    BOOST_CHECK_THROW(Real("3L"), std::runtime_error);
    BOOST_CHECK_THROW(Real(Real(20) / 0u), std::overflow_error);
+ //
+ // Extra tests added for full coverage:
+ //
+ a = 20;
+ b = 7;
+ c = 20 % b;
+ BOOST_TEST(c == (20 % 7));
+ c = 20 % (b + 0);
+ BOOST_TEST(c == (20 % 7));
+ c = a & 10;
+ BOOST_TEST(c == (20 & 10));
+ c = 10 & a;
+ BOOST_TEST(c == (20 & 10));
+ c = (a + 0) & (b + 0);
+ BOOST_TEST(c == (20 & 7));
+ c = 10 & (a + 0);
+ BOOST_TEST(c == (20 & 10));
+ c = 10 | a;
+ BOOST_TEST(c == (20 | 10));
+ c = (a + 0) | (b + 0);
+ BOOST_TEST(c == (20 | 7))
+ c = 20 | (b + 0);
+ BOOST_TEST(c == (20 | 7));
+ c = a ^ 7;
+ BOOST_TEST(c == (20 ^ 7));
+ c = 20 ^ b;
+ BOOST_TEST(c == (20 ^ 7));
+ c = (a + 0) ^ (b + 0);
+ BOOST_TEST(c == (20 ^ 7));
+ c = 20 ^ (b + 0);
+ BOOST_TEST(c == (20 ^ 7));
 }
 
 template <class Real, class T>
@@ -785,6 +931,95 @@
    BOOST_TEST(r == static_cast<cast_type>(n4 * n5));
    r = static_cast<cast_type>(4 * n4) / Real(4);
    BOOST_TEST(r == static_cast<cast_type>(n4));
+
+ Real a, b, c;
+ a = 20;
+ b = 30;
+ c = -a + b;
+ BOOST_TEST(c == 10);
+ c = b + -a;
+ BOOST_TEST(c == 10);
+ n4 = 30;
+ c = -a + static_cast<cast_type>(n4);
+ BOOST_TEST(c == 10);
+ c = static_cast<cast_type>(n4) + -a;
+ BOOST_TEST(c == 10);
+ c = -a + -b;
+ BOOST_TEST(c == -50);
+ n4 = 4;
+ c = -(a + b) + static_cast<cast_type>(n4);
+ BOOST_TEST(c == -50+4);
+ n4 = 50;
+ c = (a + b) - static_cast<cast_type>(n4);
+ BOOST_TEST(c == 0);
+ c = (a + b) - static_cast<cast_type>(n4);
+ BOOST_TEST(c == 0);
+ c = a - -(b + static_cast<cast_type>(n4));
+ BOOST_TEST(c == 20 - -(30 + 50));
+ c = -(b + static_cast<cast_type>(n4)) - a;
+ BOOST_TEST(c == -(30 + 50) - 20);
+ c = a - -b;
+ BOOST_TEST(c == 50);
+ c = -a - b;
+ BOOST_TEST(c == -50);
+ c = -a - static_cast<cast_type>(n4);
+ BOOST_TEST(c == -20 - 50);
+ c = static_cast<cast_type>(n4) - -a;
+ BOOST_TEST(c == 50 + 20);
+ c = -(a + b) - Real(n4);
+ BOOST_TEST(c == -(20 + 30) - 50);
+ c = static_cast<cast_type>(n4) - (a + b);
+ BOOST_TEST(c == 0);
+ c = (a + b) * static_cast<cast_type>(n4);
+ BOOST_TEST(c == 50 * 50);
+ c = static_cast<cast_type>(n4) * (a + b);
+ BOOST_TEST(c == 50 * 50);
+ c = a * -(b + static_cast<cast_type>(n4));
+ BOOST_TEST(c == 20 * -(30 + 50));
+ c = -(b + static_cast<cast_type>(n4)) * a;
+ BOOST_TEST(c == 20 * -(30 + 50));
+ c = a * -b;
+ BOOST_TEST(c == 20 * -30);
+ c = -a * b;
+ BOOST_TEST(c == 20 * -30);
+ c = -a * static_cast<cast_type>(n4);
+ BOOST_TEST(c == -20 * 50);
+ c = static_cast<cast_type>(n4) * -a;
+ BOOST_TEST(c == -20 * 50);
+ c = -(a + b) + a;
+ BOOST_TEST(-50 + 20);
+ c = static_cast<cast_type>(n4) - (a + b);
+ BOOST_TEST(c == 0);
+ Real d = 10;
+ c = (a + b) / d;
+ BOOST_TEST(c == 5);
+ c = (a + b) / (d + 0);
+ BOOST_TEST(c == 5);
+ c = (a + b) / static_cast<cast_type>(n4);
+ BOOST_TEST(c == 1);
+ c = static_cast<cast_type>(n4) / (a + b);
+ BOOST_TEST(c == 1);
+ d = 50;
+ c = d / -(a + b);
+ BOOST_TEST(c == -1);
+ c = -(a + b) / d;
+ BOOST_TEST(c == -1);
+ d = 2;
+ c = a / -d;
+ BOOST_TEST(c == 20 / -2);
+ c = -a / d;
+ BOOST_TEST(c == 20 / -2);
+ d = 50;
+ c = -d / static_cast<cast_type>(n4);
+ BOOST_TEST(c == -1);
+ c = static_cast<cast_type>(n4) / -d;
+ BOOST_TEST(c == -1);
+ c = static_cast<cast_type>(n4) + a;
+ BOOST_TEST(c == 70);
+ c = static_cast<cast_type>(n4) - a;
+ BOOST_TEST(c == 30);
+ c = static_cast<cast_type>(n4) * a;
+ BOOST_TEST(c == 50 * 20);
 }
 
 template <class Real, class Num>
@@ -793,7 +1028,12 @@
 }
 
 template <class Real, class Num>
-void test_mixed()
+void test_mixed(const boost::mpl::false_&)
+{
+}
+
+template <class Real, class Num>
+void test_mixed(const boost::mpl::true_&)
 {
    typedef typename lexical_cast_target_type<Num>::type target_type;
    typedef typename boost::mpl::if_<
@@ -906,25 +1146,58 @@
 }
 
 template <class Real>
+void test_members(Real)
+{
+ //
+ // Test sign and zero functions:
+ //
+ Real a = 20;
+ Real b = 30;
+ BOOST_TEST(a.sign() > 0);
+ BOOST_TEST(!a.is_zero());
+ if(std::numeric_limits<Real>::is_signed)
+ {
+ a = -20;
+ BOOST_TEST(a.sign() < 0);
+ BOOST_TEST(!a.is_zero());
+ }
+ a = 0;
+ BOOST_TEST(a.sign() == 0);
+ BOOST_TEST(a.is_zero());
+
+ a = 20;
+ b = 30;
+ a.swap(b);
+ BOOST_TEST(a == 30);
+ BOOST_TEST(b == 20);
+}
+
+template <class Real>
+void test_members(boost::rational<Real> v)
+{
+}
+
+template <class Real>
 void test()
 {
 #ifndef NO_MIXED_OPS
- test_mixed<Real, unsigned char>();
- test_mixed<Real, signed char>();
- test_mixed<Real, char>();
- test_mixed<Real, short>();
- test_mixed<Real, unsigned short>();
- test_mixed<Real, int>();
- test_mixed<Real, unsigned int>();
- test_mixed<Real, long>();
- test_mixed<Real, unsigned long>();
+ boost::multiprecision::is_number<Real> tag;
+ test_mixed<Real, unsigned char>(tag);
+ test_mixed<Real, signed char>(tag);
+ test_mixed<Real, char>(tag);
+ test_mixed<Real, short>(tag);
+ test_mixed<Real, unsigned short>(tag);
+ test_mixed<Real, int>(tag);
+ test_mixed<Real, unsigned int>(tag);
+ test_mixed<Real, long>(tag);
+ test_mixed<Real, unsigned long>(tag);
 #ifdef BOOST_HAS_LONG_LONG
- test_mixed<Real, long long>();
- test_mixed<Real, unsigned long long>();
+ test_mixed<Real, long long>(tag);
+ test_mixed<Real, unsigned long long>(tag);
 #endif
- test_mixed<Real, float>();
- test_mixed<Real, double>();
- test_mixed<Real, long double>();
+ test_mixed<Real, float>(tag);
+ test_mixed<Real, double>(tag);
+ test_mixed<Real, long double>(tag);
 #endif
    //
    // Integer only functions:
@@ -1175,23 +1448,11 @@
    BOOST_TEST((72 < b+a) == false);
    BOOST_TEST((72 >= b+a) == true);
    BOOST_TEST((72 > b+a) == false);
-#ifndef NO_MIXED_OPS
+
+ test_members(a);
    //
- // Test sign and zero functions, plus use in boolian context:
+ // Use in Boolean context:
    //
- a = 20;
- BOOST_TEST(a.sign() > 0);
- BOOST_TEST(!a.is_zero());
- if(std::numeric_limits<Real>::is_signed)
- {
- a = -20;
- BOOST_TEST(a.sign() < 0);
- BOOST_TEST(!a.is_zero());
- }
- a = 0;
- BOOST_TEST(a.sign() == 0);
- BOOST_TEST(a.is_zero());
-#endif
    a = 0;
    if(a)
    {
@@ -1243,6 +1504,50 @@
    ss >> c;
    BOOST_TEST(c == 22);
    BOOST_TEST(c == a + b);
+ //
+ // More cases for complete code coverage:
+ //
+ a = 20;
+ b = 30;
+ swap(a, b);
+ BOOST_TEST(a == 30);
+ BOOST_TEST(b == 20);
+ a = 20;
+ b = 30;
+ std::swap(a, b);
+ BOOST_TEST(a == 30);
+ BOOST_TEST(b == 20);
+ a = 20;
+ b = 30;
+ a = a + b * 2;
+ BOOST_TEST(a == 20 + 30 * 2);
+ a = 100;
+ a = a - b * 2;
+ BOOST_TEST(a == 100 - 30 * 2);
+ a = 20;
+ a = a * (b + 2);
+ BOOST_TEST(a == 20 * (32));
+ a = 20;
+ a = (b + 2) * a;
+ BOOST_TEST(a == 20 * (32));
+ a = 90;
+ b = 2;
+ a = a / (b + 0);
+ BOOST_TEST(a == 45);
+ a = 20;
+ b = 30;
+ c = (a * b) + 22;
+ BOOST_TEST(c == 20 * 30 + 22);
+ c = 22 + (a * b);
+ BOOST_TEST(c == 20 * 30 + 22);
+
+ //
+ // Test conditionals:
+ //
+ a = 20;
+ test_conditional(a, +a);
+ test_conditional(Real(-a), -a);
+ test_conditional(a, (a + 0));
 }
 
 
@@ -1291,20 +1596,23 @@
 #ifdef TEST_MPZ_BOOST_RATIONAL
    test<boost::rational<boost::multiprecision::mpz_int> >();
 #endif
-#ifdef TEST_CPP_INT
+#ifdef TEST_CPP_INT_1
    test<boost::multiprecision::cpp_int>();
    test<boost::multiprecision::int256_t >();
    test<boost::multiprecision::uint512_t >();
+#endif
+#ifdef TEST_CPP_INT_2
    test<boost::multiprecision::cpp_rational>();
    test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>, false> >();
    test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<500, true, void> > >();
-
+#endif
+#ifdef TEST_CPP_INT_3
    // Again with "trivial" backends:
    test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, true, void>, false > >();
    test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, false, void>, false > >();
 #endif
 #ifdef TEST_CPP_INT_BR
- test<boost::multiprecision::cpp_rational>();
+ test<boost::rational<boost::multiprecision::cpp_int> >();
 #endif
    return boost::report_errors();
 }

Modified: sandbox/big_number/libs/multiprecision/test/test_cpp_int_conv.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_cpp_int_conv.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_cpp_int_conv.cpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -51,6 +51,25 @@
    number<cpp_int_backend<32, true, void>, false> i7(i3);
    BOOST_TEST(i7 == -1234567);
 
+ int256_t i8(i6);
+ BOOST_TEST(i8 == -5677334);
+
+ i7.assign(4.0);
+ BOOST_TEST(i7 == 4);
+
+ number<cpp_int_backend<30, true, void>, false> i9(-5677334);
+ i7 = i9;
+ BOOST_TEST(i7 == -5677334);
+ i7 = number<cpp_int_backend<32, true, void>, false>(i9);
+ BOOST_TEST(i7 == -5677334);
+
+ i9 = static_cast<number<cpp_int_backend<30, true, void>, false> >(i7);
+ BOOST_TEST(i9 == -5677334);
+
+ ++i9;
+ i7 = i9;
+ BOOST_TEST(i7 == 1 - 5677334);
+
    return boost::report_errors();
 }
 

Modified: sandbox/big_number/libs/multiprecision/test/test_int_io.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_int_io.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_int_io.cpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -126,6 +126,8 @@
    test_round_trip<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<> > >();
    test_round_trip<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<1024, true, void> > >();
    test_round_trip<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<512, false, void> > >();
+ test_round_trip<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<32, true, void> > >();
+ test_round_trip<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<32, false, void> > >();
 #endif
    return boost::report_errors();
 }

Modified: sandbox/big_number/libs/multiprecision/test/test_rational_io.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_rational_io.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_rational_io.cpp 2012-08-31 07:57:55 EDT (Fri, 31 Aug 2012)
@@ -94,14 +94,14 @@
 }
 
 template <class T>
-struct is_mp_number : public boost::mpl::false_{};
+struct is_number : public boost::mpl::false_{};
 template <class T>
-struct is_mp_number<boost::multiprecision::number<T> > : public boost::mpl::true_{};
+struct is_number<boost::multiprecision::number<T> > : public boost::mpl::true_{};
 
 template <class T>
 void do_round_trip(const T& val, std::ios_base::fmtflags f)
 {
- do_round_trip(val, f, is_mp_number<T>());
+ do_round_trip(val, f, is_number<T>());
 }
 
 template <class T>


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