|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80431 - in sandbox/big_number: boost/multiprecision 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/map libs/multiprecision/doc/html/boost_multiprecision/ref libs/multiprecision/doc/html/boost_multiprecision/tut libs/multiprecision/doc/html/boost_multiprecision/tut/floats libs/multiprecision/doc/html/boost_multiprecision/tut/rational libs/multiprecision/test libs/multiprecision/test/math
From: john_at_[hidden]
Date: 2012-09-07 04:31:57
Author: johnmaddock
Date: 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
New Revision: 80431
URL: http://svn.boost.org/trac/boost/changeset/80431
Log:
Largely cosmetic change - add two new template params to cpp_dec_float - one for the exponent type, and one for an optional allocator.
Text files modified:
sandbox/big_number/boost/multiprecision/cpp_dec_float.hpp | 686 ++++++++++++++++++++-------------------
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html | 14
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html | 4
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 | 9
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html | 7
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html | 12
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html | 313 ++++++++++++++++++
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html | 4
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html | 48 +-
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html | 46 ++
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/fp_eg.html | 6
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/gmp_float.html | 6
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/mpfr_float.html | 6
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html | 30
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/cpp_rational.html | 8
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/gmp_rational.html | 8
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/tommath_rational.html | 6
sandbox/big_number/libs/multiprecision/doc/html/index.html | 6
sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk | 238 ++++++++-----
sandbox/big_number/libs/multiprecision/test/math/log1p_expm1_test.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/powm1_sqrtp1m1_test.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/table_type.hpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_bessel_i.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_bessel_j.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_bessel_k.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_bessel_y.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_beta.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_binomial_coeff.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_carlson.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_cbrt.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_digamma.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ellint_1.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ellint_2.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ellint_3.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_erf.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_expint.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_gamma.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_hermite.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ibeta.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ibeta_2.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ibeta_3.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ibeta_4.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_1.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_ab_4.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_igamma.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_igamma_inv.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_igamma_inva.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_laguerre.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_legendre.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_tgamma_ratio.cpp | 2
sandbox/big_number/libs/multiprecision/test/math/test_zeta.cpp | 2
sandbox/big_number/libs/multiprecision/test/test_acos.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp | 3
sandbox/big_number/libs/multiprecision/test/test_asin.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_atan.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_cos.cpp | 9
sandbox/big_number/libs/multiprecision/test/test_cosh.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_exp.cpp | 9
sandbox/big_number/libs/multiprecision/test/test_log.cpp | 9
sandbox/big_number/libs/multiprecision/test/test_pow.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_round.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_sin.cpp | 9
sandbox/big_number/libs/multiprecision/test/test_sinh.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_sqrt.cpp | 8
sandbox/big_number/libs/multiprecision/test/test_tanh.cpp | 8
66 files changed, 1038 insertions(+), 598 deletions(-)
Modified: sandbox/big_number/boost/multiprecision/cpp_dec_float.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_dec_float.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_dec_float.hpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -26,17 +26,28 @@
namespace multiprecision{
namespace backends{
-template <unsigned Digits10>
+template <unsigned Digits10, class ExponentType = boost::int32_t, class Allocator = void>
class cpp_dec_float;
} // namespace
-template <unsigned Digits10>
-struct number_category<backends::cpp_dec_float<Digits10> > : public mpl::int_<number_kind_floating_point>{};
+template <unsigned Digits10, class ExponentType, class Allocator>
+struct number_category<backends::cpp_dec_float<Digits10, ExponentType, Allocator> > : public mpl::int_<number_kind_floating_point>{};
namespace backends{
-template <unsigned Digits10>
+namespace detail{
+
+template <class T, unsigned S, class Allocator>
+struct dynamic_array : public std::vector<T, Allocator>
+{
+ dynamic_array()
+ : std::vector<T, Allocator>(static_cast<std::vector<T, Allocator>::size_type>(S), static_cast<T>(0)) {}
+};
+
+}
+
+template <unsigned Digits10, class ExponentType, class Allocator>
class cpp_dec_float
{
private:
@@ -46,18 +57,18 @@
typedef mpl::list<long long> signed_types;
typedef mpl::list<unsigned long long> unsigned_types;
typedef mpl::list<long double> float_types;
- typedef long long exponent_type;
+ typedef ExponentType exponent_type;
static const boost::int32_t cpp_dec_float_radix = 10L;
static const boost::int32_t cpp_dec_float_digits10_limit_lo = 9L;
static const boost::int32_t cpp_dec_float_digits10_limit_hi = boost::integer_traits<boost::int32_t>::const_max - 100;
static const boost::int32_t cpp_dec_float_digits10 = ((cpp_dec_float_digits10_setting < cpp_dec_float_digits10_limit_lo) ? cpp_dec_float_digits10_limit_lo : ((cpp_dec_float_digits10_setting > cpp_dec_float_digits10_limit_hi) ? cpp_dec_float_digits10_limit_hi : cpp_dec_float_digits10_setting));
- static const boost::int64_t cpp_dec_float_max_exp10 = static_cast<boost::int64_t>( 2776234983093287512LL);
- static const boost::int64_t cpp_dec_float_min_exp10 = static_cast<boost::int64_t>(-2776234983093287512LL);
- static const boost::int64_t cpp_dec_float_max_exp = static_cast<boost::int64_t>((cpp_dec_float_max_exp10 / 301LL) * 1000LL);
- static const boost::int64_t cpp_dec_float_min_exp = static_cast<boost::int64_t>((cpp_dec_float_min_exp10 / 301LL) * 1000LL);
+ static const ExponentType cpp_dec_float_max_exp10 = (static_cast<ExponentType>(1) << (std::numeric_limits<ExponentType>::digits - 5));
+ static const ExponentType cpp_dec_float_min_exp10 = -cpp_dec_float_max_exp10;
+ static const ExponentType cpp_dec_float_max_exp = static_cast<ExponentType>((cpp_dec_float_max_exp10 / 301LL) * 1000LL);
+ static const ExponentType cpp_dec_float_min_exp = static_cast<ExponentType>((cpp_dec_float_min_exp10 / 301LL) * 1000LL);
- BOOST_STATIC_ASSERT(cpp_dec_float_max_exp10 == -cpp_dec_float_min_exp10);
+ BOOST_STATIC_ASSERT((cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_max_exp10 == -cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_min_exp10));
private:
static const boost::int32_t cpp_dec_float_elem_digits10 = 8L;
@@ -89,10 +100,13 @@
}
fpclass_type;
- typedef boost::array<boost::uint32_t, cpp_dec_float_elem_number> array_type;
+ typedef typename mpl::if_<is_void<Allocator>,
+ boost::array<boost::uint32_t, cpp_dec_float_elem_number>,
+ detail::dynamic_array<boost::uint32_t, cpp_dec_float_elem_number, Allocator>
+ >::type array_type;
array_type data;
- boost::int64_t exp;
+ ExponentType exp;
bool neg;
fpclass_type fpclass;
boost::int32_t prec_elem;
@@ -102,7 +116,7 @@
//
cpp_dec_float(fpclass_type c) BOOST_NOEXCEPT :
data(),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (c),
prec_elem(cpp_dec_float_elem_number) { }
@@ -114,23 +128,23 @@
{
initializer()
{
- cpp_dec_float<Digits10>::nan();
- cpp_dec_float<Digits10>::inf();
- (cpp_dec_float<Digits10>::min)();
- (cpp_dec_float<Digits10>::max)();
- cpp_dec_float<Digits10>::zero();
- cpp_dec_float<Digits10>::one();
- cpp_dec_float<Digits10>::two();
- cpp_dec_float<Digits10>::half();
- cpp_dec_float<Digits10>::double_min();
- cpp_dec_float<Digits10>::double_max();
- cpp_dec_float<Digits10>::long_double_max();
- cpp_dec_float<Digits10>::long_double_min();
- cpp_dec_float<Digits10>::long_long_max();
- cpp_dec_float<Digits10>::long_long_min();
- cpp_dec_float<Digits10>::ulong_long_max();
- cpp_dec_float<Digits10>::eps();
- cpp_dec_float<Digits10>::pow2(0);
+ cpp_dec_float<Digits10, ExponentType, Allocator>::nan();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::inf();
+ (cpp_dec_float<Digits10, ExponentType, Allocator>::min)();
+ (cpp_dec_float<Digits10, ExponentType, Allocator>::max)();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::zero();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::one();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::two();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::half();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::double_min();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::double_max();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::long_double_max();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::long_double_min();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::long_long_max();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::long_long_min();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::ulong_long_max();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::eps();
+ cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(0);
}
void do_nothing(){}
};
@@ -141,14 +155,14 @@
// Constructors
cpp_dec_float() BOOST_NOEXCEPT :
data(),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (cpp_dec_float_finite),
prec_elem(cpp_dec_float_elem_number) { }
cpp_dec_float(const char* s) :
data(),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (cpp_dec_float_finite),
prec_elem(cpp_dec_float_elem_number)
@@ -159,7 +173,7 @@
template<class I>
cpp_dec_float(I i, typename enable_if<is_unsigned<I> >::type* = 0) BOOST_NOEXCEPT :
data(),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (cpp_dec_float_finite),
prec_elem(cpp_dec_float_elem_number)
@@ -170,7 +184,7 @@
template <class I>
cpp_dec_float(I i, typename enable_if<is_signed<I> >::type* = 0) BOOST_NOEXCEPT :
data(),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (cpp_dec_float_finite),
prec_elem(cpp_dec_float_elem_number)
@@ -191,8 +205,8 @@
fpclass (f.fpclass),
prec_elem(f.prec_elem) { }
- template <unsigned D>
- cpp_dec_float(const cpp_dec_float<D>& f, typename enable_if_c<D <= Digits10>::type* = 0) BOOST_NOEXCEPT :
+ template <unsigned D, class ET, class A>
+ cpp_dec_float(const cpp_dec_float<D, ET, A>& f, typename enable_if_c<D <= Digits10>::type* = 0) BOOST_NOEXCEPT :
data(),
exp (f.exp),
neg (f.neg),
@@ -201,8 +215,8 @@
{
std::copy(f.data.begin(), f.data.begin() + f.prec_elem, data.begin());
}
- template <unsigned D>
- explicit cpp_dec_float(const cpp_dec_float<D>& f, typename disable_if_c<D <= Digits10>::type* = 0) BOOST_NOEXCEPT :
+ template <unsigned D, class ET, class A>
+ explicit cpp_dec_float(const cpp_dec_float<D, ET, A>& f, typename disable_if_c<D <= Digits10>::type* = 0) BOOST_NOEXCEPT :
data(),
exp (f.exp),
neg (f.neg),
@@ -216,7 +230,7 @@
template <class F>
cpp_dec_float(const F val, typename enable_if<is_floating_point<F> >::type* = 0) BOOST_NOEXCEPT :
data(),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (cpp_dec_float_finite),
prec_elem(cpp_dec_float_elem_number)
@@ -224,7 +238,7 @@
*this = val;
}
- cpp_dec_float(const double val, long long exponent) BOOST_NOEXCEPT;
+ cpp_dec_float(const double val, ExponentType exponent) BOOST_NOEXCEPT;
// Specific special values.
static const cpp_dec_float& nan() BOOST_NOEXCEPT
@@ -440,7 +454,7 @@
template <class V>
int compare(const V& v)const BOOST_NOEXCEPT
{
- cpp_dec_float<Digits10> t;
+ cpp_dec_float<Digits10, ExponentType, Allocator> t;
t = v;
return compare(t);
}
@@ -458,7 +472,7 @@
long double extract_long_double (void) const BOOST_NOEXCEPT;
signed long long extract_signed_long_long (void) const BOOST_NOEXCEPT;
unsigned long long extract_unsigned_long_long(void) const BOOST_NOEXCEPT;
- void extract_parts (double& mantissa, boost::int64_t& exponent) const BOOST_NOEXCEPT;
+ void extract_parts (double& mantissa, ExponentType& exponent) const BOOST_NOEXCEPT;
cpp_dec_float extract_integer_part (void) const BOOST_NOEXCEPT;
void precision(const boost::int32_t prec_digits) BOOST_NOEXCEPT
{
@@ -475,13 +489,13 @@
}
}
static cpp_dec_float pow2(long long i) BOOST_NOEXCEPT;
- long long order()const BOOST_NOEXCEPT
+ ExponentType order()const BOOST_NOEXCEPT
{
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:
//
- boost::uint32_t prefix = 0;
+ ExponentType prefix = 0;
if(data[0] >= 100000UL)
{
@@ -523,7 +537,7 @@
}
}
- return (bo_order_is_zero ? static_cast<long long>(0) : static_cast<long long>(exp + prefix));
+ return (bo_order_is_zero ? static_cast<ExponentType>(0) : static_cast<ExponentType>(exp + prefix));
}
private:
@@ -542,44 +556,44 @@
bool rd_string(const char* const s);
- template <unsigned D>
+ template <unsigned D, class ET, class A>
friend class cpp_dec_float;
};
-template <unsigned Digits10>
-typename cpp_dec_float<Digits10>::initializer cpp_dec_float<Digits10>::init;
+template <unsigned Digits10, class ExponentType, class Allocator>
+typename cpp_dec_float<Digits10, ExponentType, Allocator>::initializer cpp_dec_float<Digits10, ExponentType, Allocator>::init;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_radix;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_digits10_setting;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_digits10_limit_lo;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_digits10_limit_hi;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_digits10;
-template <unsigned Digits10>
-const boost::int64_t cpp_dec_float<Digits10>::cpp_dec_float_max_exp;
-template <unsigned Digits10>
-const boost::int64_t cpp_dec_float<Digits10>::cpp_dec_float_min_exp;
-template <unsigned Digits10>
-const boost::int64_t cpp_dec_float<Digits10>::cpp_dec_float_max_exp10;
-template <unsigned Digits10>
-const boost::int64_t cpp_dec_float<Digits10>::cpp_dec_float_min_exp10;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_elem_digits10;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_elem_number_request;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_elem_number;
-template <unsigned Digits10>
-const boost::int32_t cpp_dec_float<Digits10>::cpp_dec_float_elem_mask;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_radix;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10_setting;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10_limit_lo;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10_limit_hi;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const ExponentType cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_max_exp;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const ExponentType cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_min_exp;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const ExponentType cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_max_exp10;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const ExponentType cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_min_exp10;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_elem_digits10;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_elem_number_request;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_elem_number;
+template <unsigned Digits10, class ExponentType, class Allocator>
+const boost::int32_t cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_elem_mask;
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::operator+=(const cpp_dec_float<Digits10>& v) BOOST_NOEXCEPT
+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) BOOST_NOEXCEPT
{
if(isnan())
{
@@ -601,9 +615,9 @@
}
// Get the offset for the add/sub operation.
- static const boost::int64_t max_delta_exp = static_cast<boost::int64_t>((cpp_dec_float_elem_number - 1) * cpp_dec_float_elem_digits10);
+ static const ExponentType max_delta_exp = static_cast<ExponentType>((cpp_dec_float_elem_number - 1) * cpp_dec_float_elem_digits10);
- const boost::int64_t ofs_exp = static_cast<boost::int64_t>(exp - v.exp);
+ const ExponentType ofs_exp = static_cast<ExponentType>(exp - v.exp);
// Check if the operation is out of range, requiring special handling.
if(v.iszero() || (ofs_exp > max_delta_exp))
@@ -666,7 +680,7 @@
{
std::copy_backward(data.begin(), data.end() - static_cast<std::size_t>(1u), data.end());
data[0] = carry;
- exp += static_cast<boost::int64_t>(cpp_dec_float_elem_digits10);
+ exp += static_cast<ExponentType>(cpp_dec_float_elem_digits10);
}
}
else
@@ -748,7 +762,7 @@
// This result of the subtraction is exactly zero.
// Reset the sign and the exponent.
neg = false;
- exp = static_cast<boost::int64_t>(0);
+ exp = static_cast<ExponentType>(0);
}
else
{
@@ -758,7 +772,7 @@
std::copy(data.begin() + static_cast<std::size_t>(sj), data.end(), data.begin());
std::fill(data.end() - sj, data.end(), static_cast<boost::uint32_t>(0u));
- exp -= static_cast<boost::int64_t>(sj * static_cast<std::size_t>(cpp_dec_float_elem_digits10));
+ exp -= static_cast<ExponentType>(sj * static_cast<std::size_t>(cpp_dec_float_elem_digits10));
}
}
}
@@ -798,8 +812,8 @@
return *this;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::operator-=(const cpp_dec_float<Digits10>& v) BOOST_NOEXCEPT
+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) BOOST_NOEXCEPT
{
// Use *this - v = -(-*this + v).
negate();
@@ -808,8 +822,8 @@
return *this;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::operator*=(const cpp_dec_float<Digits10>& v) BOOST_NOEXCEPT
+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) BOOST_NOEXCEPT
{
// Evaluate the sign of the result.
const bool b_result_is_neg = (neg != v.neg);
@@ -846,17 +860,17 @@
}
// Check for overflow or underflow.
- const bool u_exp_is_neg = (exp < static_cast<boost::int64_t>(0));
- const bool v_exp_is_neg = (v.exp < static_cast<boost::int64_t>(0));
+ const bool u_exp_is_neg = (exp < static_cast<ExponentType>(0));
+ const bool v_exp_is_neg = (v.exp < static_cast<ExponentType>(0));
if(u_exp_is_neg == v_exp_is_neg)
{
// Get the unsigned base-10 exponents of *this and v and...
- const boost::int64_t u_exp = ((!u_exp_is_neg) ? exp : static_cast<boost::int64_t>( -exp));
- const boost::int64_t v_exp = ((!v_exp_is_neg) ? v.exp : static_cast<boost::int64_t>(-v.exp));
+ const ExponentType u_exp = ((!u_exp_is_neg) ? exp : static_cast<ExponentType>( -exp));
+ const ExponentType v_exp = ((!v_exp_is_neg) ? v.exp : static_cast<ExponentType>(-v.exp));
// Check the range of the upcoming multiplication.
- const bool b_result_is_out_of_range = (v_exp >= static_cast<boost::int64_t>(cpp_dec_float_max_exp10 - u_exp));
+ const bool b_result_is_out_of_range = (v_exp >= static_cast<ExponentType>(cpp_dec_float_max_exp10 - u_exp));
if(b_result_is_out_of_range)
{
@@ -901,8 +915,8 @@
return *this;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::operator/=(const cpp_dec_float<Digits10>& v) BOOST_NOEXCEPT
+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) BOOST_NOEXCEPT
{
const bool u_and_v_are_finite_and_identical = ( isfinite()
&& (fpclass == v.fpclass)
@@ -936,8 +950,8 @@
}
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::mul_unsigned_long_long(const unsigned long long n) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::mul_unsigned_long_long(const unsigned long long n) BOOST_NOEXCEPT
{
// Multiply *this with a constant unsigned long long.
@@ -991,7 +1005,7 @@
// Handle the carry and adjust the exponent.
if(carry != static_cast<boost::uint32_t>(0u))
{
- exp += static_cast<boost::int64_t>(cpp_dec_float_elem_digits10);
+ exp += static_cast<ExponentType>(cpp_dec_float_elem_digits10);
// Shift the result of the multiplication one element to the right.
std::copy_backward(data.begin(),
@@ -1031,8 +1045,8 @@
return *this;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::div_unsigned_long_long(const unsigned long long n) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::div_unsigned_long_long(const unsigned long long n) BOOST_NOEXCEPT
{
// Divide *this by a constant unsigned long long.
@@ -1097,7 +1111,7 @@
if(data[0] == static_cast<boost::uint32_t>(0u))
{
// Adjust the exponent
- exp -= static_cast<boost::int64_t>(cpp_dec_float_elem_digits10);
+ exp -= static_cast<ExponentType>(cpp_dec_float_elem_digits10);
// Shift result of the division one element to the left.
std::copy(data.begin() + static_cast<std::size_t>(1u),
@@ -1120,8 +1134,8 @@
return *this;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::calculate_inv() BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::calculate_inv() BOOST_NOEXCEPT
{
// Compute the inverse of *this.
const bool b_neg = neg;
@@ -1155,17 +1169,17 @@
}
// Save the original *this.
- cpp_dec_float<Digits10> x(*this);
+ cpp_dec_float<Digits10, ExponentType, Allocator> x(*this);
// Generate the initial estimate using division.
// Extract the mantissa and exponent for a "manual"
// computation of the estimate.
double dd;
- boost::int64_t ne;
+ ExponentType ne;
x.extract_parts(dd, ne);
// Do the inverse estimate using double precision estimates of mantissa and exponent.
- operator=(cpp_dec_float<Digits10>(1.0 / dd, -ne));
+ operator=(cpp_dec_float<Digits10, ExponentType, Allocator>(1.0 / dd, -ne));
// Compute the inverse of *this. Quadratically convergent Newton-Raphson iteration
// is used. During the iterative steps, the precision of the calculation is limited
@@ -1194,8 +1208,8 @@
return *this;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::calculate_sqrt(void) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::calculate_sqrt(void) BOOST_NOEXCEPT
{
// Compute the square root of *this.
@@ -1211,17 +1225,17 @@
}
// Save the original *this.
- cpp_dec_float<Digits10> x(*this);
+ cpp_dec_float<Digits10, ExponentType, Allocator> x(*this);
// Generate the initial estimate using division.
// Extract the mantissa and exponent for a "manual"
// computation of the estimate.
double dd;
- boost::int64_t ne;
+ ExponentType ne;
extract_parts(dd, ne);
// Force the exponent to be an even multiple of two.
- if((ne % static_cast<boost::int64_t>(2)) != static_cast<boost::int64_t>(0))
+ if((ne % static_cast<ExponentType>(2)) != static_cast<ExponentType>(0))
{
++ne;
dd /= 10.0;
@@ -1231,10 +1245,10 @@
// Estimate the square root using simple manipulations.
const double sqd = std::sqrt(dd);
- *this = cpp_dec_float<Digits10>(sqd, static_cast<boost::int64_t>(ne / static_cast<boost::int64_t>(2)));
+ *this = cpp_dec_float<Digits10, ExponentType, Allocator>(sqd, static_cast<ExponentType>(ne / static_cast<ExponentType>(2)));
// Estimate 1.0 / (2.0 * x0) using simple manipulations.
- cpp_dec_float<Digits10> vi(0.5 / sqd, static_cast<boost::int64_t>(-ne / static_cast<boost::int64_t>(2)));
+ cpp_dec_float<Digits10, ExponentType, Allocator> vi(0.5 / sqd, static_cast<ExponentType>(-ne / static_cast<ExponentType>(2)));
// Compute the square root of x. Coupled Newton iteration
// as described in "Pi Unleashed" is used. During the
@@ -1277,8 +1291,8 @@
return *this;
}
-template <unsigned Digits10>
-int cpp_dec_float<Digits10>::cmp_data(const array_type& vd) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+int cpp_dec_float<Digits10, ExponentType, Allocator>::cmp_data(const array_type& vd) const BOOST_NOEXCEPT
{
// Compare the data of *this with those of v.
// Return +1 for *this > v
@@ -1299,8 +1313,8 @@
}
}
-template <unsigned Digits10>
-int cpp_dec_float<Digits10>::compare(const cpp_dec_float& v) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+int cpp_dec_float<Digits10, ExponentType, Allocator>::compare(const cpp_dec_float& v) const BOOST_NOEXCEPT
{
// Compare v with *this.
// Return +1 for *this > v
@@ -1377,8 +1391,8 @@
}
}
-template <unsigned Digits10>
-bool cpp_dec_float<Digits10>::isone() const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+bool cpp_dec_float<Digits10, ExponentType, Allocator>::isone() const BOOST_NOEXCEPT
{
// Check if the value of *this is identically 1 or very close to 1.
@@ -1386,12 +1400,12 @@
if(not_negative_and_is_finite)
{
- if((data[0u] == static_cast<boost::uint32_t>(1u)) && (exp == static_cast<boost::int64_t>(0)))
+ if((data[0u] == static_cast<boost::uint32_t>(1u)) && (exp == static_cast<ExponentType>(0)))
{
const typename array_type::const_iterator it_non_zero = std::find_if(data.begin(), data.end(), data_elem_is_non_zero_predicate);
return (it_non_zero == data.end());
}
- else if((data[0u] == static_cast<boost::uint32_t>(cpp_dec_float_elem_mask - 1)) && (exp == static_cast<boost::int64_t>(-cpp_dec_float_elem_digits10)))
+ else if((data[0u] == static_cast<boost::uint32_t>(cpp_dec_float_elem_mask - 1)) && (exp == static_cast<ExponentType>(-cpp_dec_float_elem_digits10)))
{
const typename array_type::const_iterator it_non_nine = std::find_if(data.begin(), data.end(), data_elem_is_non_nine_predicate);
return (it_non_nine == data.end());
@@ -1401,14 +1415,14 @@
return false;
}
-template <unsigned Digits10>
-bool cpp_dec_float<Digits10>::isint() const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+bool cpp_dec_float<Digits10, ExponentType, Allocator>::isint() const BOOST_NOEXCEPT
{
if(fpclass != cpp_dec_float_finite) { return false; }
if(iszero()) { return true; }
- if(exp < static_cast<boost::int64_t>(0)) { return false; } // |*this| < 1.
+ if(exp < static_cast<ExponentType>(0)) { return false; } // |*this| < 1.
const typename array_type::size_type offset_decimal_part = static_cast<typename array_type::size_type>(exp / cpp_dec_float_elem_digits10) + 1u;
@@ -1424,10 +1438,10 @@
return (it_non_zero == data.end());
}
-template <unsigned Digits10>
-void cpp_dec_float<Digits10>::extract_parts(double& mantissa, boost::int64_t& exponent) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+void cpp_dec_float<Digits10, ExponentType, Allocator>::extract_parts(double& mantissa, ExponentType& exponent) const BOOST_NOEXCEPT
{
- // Extract the approximate parts mantissa and base-10 exponent from the input cpp_dec_float<Digits10> value x.
+ // Extract the approximate parts mantissa and base-10 exponent from the input cpp_dec_float<Digits10, ExponentType, Allocator> value x.
// Extracts the mantissa and exponent.
exponent = exp;
@@ -1457,12 +1471,12 @@
if(neg) { mantissa = -mantissa; }
}
-template <unsigned Digits10>
-double cpp_dec_float<Digits10>::extract_double(void) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+double cpp_dec_float<Digits10, ExponentType, Allocator>::extract_double(void) const BOOST_NOEXCEPT
{
- // Returns the double conversion of a cpp_dec_float<Digits10>.
+ // Returns the double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>.
- // Check for non-normal cpp_dec_float<Digits10>.
+ // Check for non-normal cpp_dec_float<Digits10, ExponentType, Allocator>.
if(!isfinite())
{
if(isnan())
@@ -1476,17 +1490,17 @@
}
}
- cpp_dec_float<Digits10> xx(*this);
+ cpp_dec_float<Digits10, ExponentType, Allocator> xx(*this);
if(xx.isneg())
xx.negate();
- // Check if *this cpp_dec_float<Digits10> is zero.
+ // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> is zero.
if(iszero() || (xx.compare(double_min()) < 0))
{
return 0.0;
}
- // Check if *this cpp_dec_float<Digits10> exceeds the maximum of double.
+ // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> exceeds the maximum of double.
if(xx.compare(double_max()) > 0)
{
return ((!neg) ? std::numeric_limits<double>::infinity()
@@ -1503,12 +1517,12 @@
return d;
}
-template <unsigned Digits10>
-long double cpp_dec_float<Digits10>::extract_long_double(void) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+long double cpp_dec_float<Digits10, ExponentType, Allocator>::extract_long_double(void) const BOOST_NOEXCEPT
{
- // Returns the long double conversion of a cpp_dec_float<Digits10>.
+ // Returns the long double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>.
- // Check if *this cpp_dec_float<Digits10> is subnormal.
+ // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> is subnormal.
if(!isfinite())
{
if(isnan())
@@ -1522,17 +1536,17 @@
}
}
- cpp_dec_float<Digits10> xx(*this);
+ cpp_dec_float<Digits10, ExponentType, Allocator> xx(*this);
if(xx.isneg())
xx.negate();
- // Check if *this cpp_dec_float<Digits10> is zero.
+ // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> is zero.
if(iszero() || (xx.compare(long_double_min()) < 0))
{
return static_cast<long double>(0.0);
}
- // Check if *this cpp_dec_float<Digits10> exceeds the maximum of double.
+ // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> exceeds the maximum of double.
if(xx.compare(long_double_max()) > 0)
{
return ((!neg) ? std::numeric_limits<long double>::infinity()
@@ -1549,14 +1563,14 @@
return ld;
}
-template <unsigned Digits10>
-signed long long cpp_dec_float<Digits10>::extract_signed_long_long(void) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+signed long long cpp_dec_float<Digits10, ExponentType, Allocator>::extract_signed_long_long(void) const BOOST_NOEXCEPT
{
// Extracts a signed long long from *this.
// If (x > maximum of signed long long) or (x < minimum of signed long long),
// then the maximum or minimum of signed long long is returned accordingly.
- if(exp < static_cast<boost::int64_t>(0))
+ if(exp < static_cast<ExponentType>(0))
{
return static_cast<signed long long>(0);
}
@@ -1576,7 +1590,7 @@
else
{
// Extract the data into an unsigned long long value.
- cpp_dec_float<Digits10> xn(extract_integer_part());
+ cpp_dec_float<Digits10, ExponentType, Allocator> xn(extract_integer_part());
if(xn.isneg())
xn.negate();
@@ -1594,8 +1608,8 @@
return ((!b_neg) ? static_cast<signed long long>(val) : static_cast<signed long long>(-static_cast<signed long long>(val)));
}
-template <unsigned Digits10>
-unsigned long long cpp_dec_float<Digits10>::extract_unsigned_long_long(void) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+unsigned long long cpp_dec_float<Digits10, ExponentType, Allocator>::extract_unsigned_long_long(void) const BOOST_NOEXCEPT
{
// Extracts an unsigned long long from *this.
// If x exceeds the maximum of unsigned long long,
@@ -1608,12 +1622,12 @@
return static_cast<unsigned long long>(extract_signed_long_long());
}
- if(exp < static_cast<boost::int64_t>(0))
+ if(exp < static_cast<ExponentType>(0))
{
return static_cast<unsigned long long>(0u);
}
- const cpp_dec_float<Digits10> xn(extract_integer_part());
+ const cpp_dec_float<Digits10, ExponentType, Allocator> xn(extract_integer_part());
unsigned long long val;
@@ -1638,8 +1652,8 @@
return val;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10> cpp_dec_float<Digits10>::extract_integer_part(void) const BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator> cpp_dec_float<Digits10, ExponentType, Allocator>::extract_integer_part(void) const BOOST_NOEXCEPT
{
// Compute the signed integer part of x.
@@ -1648,7 +1662,7 @@
return *this;
}
- if(exp < static_cast<boost::int64_t>(0))
+ if(exp < static_cast<ExponentType>(0))
{
// The absolute value of the number is smaller than 1.
// Thus the integer part is zero.
@@ -1662,7 +1676,7 @@
}
// Make a local copy.
- cpp_dec_float<Digits10> x = *this;
+ cpp_dec_float<Digits10, ExponentType, Allocator> x = *this;
// Clear out the decimal portion
const size_t first_clear = (static_cast<size_t>(x.exp) / static_cast<size_t>(cpp_dec_float_elem_digits10)) + 1u;
@@ -1673,8 +1687,8 @@
return x;
}
-template <unsigned Digits10>
-std::string cpp_dec_float<Digits10>::str(boost::intmax_t number_of_digits, std::ios_base::fmtflags f) const
+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())
{
@@ -1692,7 +1706,7 @@
std::string str;
boost::intmax_t org_digits(number_of_digits);
- boost::int64_t my_exp = order();
+ ExponentType my_exp = order();
if(number_of_digits == 0)
number_of_digits = cpp_dec_float_total_digits10;
if(f & std::ios_base::fixed)
@@ -1701,14 +1715,14 @@
}
else if(f & std::ios_base::scientific)
++number_of_digits;
- // Determine the number of elements needed to provide the requested digits from cpp_dec_float<Digits10>.
+ // Determine the number of elements needed to provide the requested digits from cpp_dec_float<Digits10, ExponentType, Allocator>.
const std::size_t number_of_elements = (std::min)(static_cast<std::size_t>((number_of_digits / static_cast<std::size_t>(cpp_dec_float_elem_digits10)) + 2u),
static_cast<std::size_t>(cpp_dec_float_elem_number));
- // Extract the remaining digits from cpp_dec_float<Digits10> after the decimal point.
+ // Extract the remaining digits from cpp_dec_float<Digits10, ExponentType, Allocator> after the decimal point.
str = boost::lexical_cast<std::string>(data[0]);
- // Extract all of the digits from cpp_dec_float<Digits10>, beginning with the first data element.
+ // Extract all of the digits from cpp_dec_float<Digits10, ExponentType, Allocator>, beginning with the first data element.
for(std::size_t i = static_cast<std::size_t>(1u); i < number_of_elements; i++)
{
std::stringstream ss;
@@ -1826,8 +1840,8 @@
return str;
}
-template <unsigned Digits10>
-bool cpp_dec_float<Digits10>::rd_string(const char* const s)
+template <unsigned Digits10, class ExponentType, class Allocator>
+bool cpp_dec_float<Digits10, ExponentType, Allocator>::rd_string(const char* const s)
{
try{
@@ -1837,7 +1851,7 @@
// the code complexity (and perhaps the run-time) of rd_string().
// Get a possible exponent and remove it.
- exp = static_cast<boost::int64_t>(0);
+ exp = static_cast<ExponentType>(0);
std::size_t pos;
@@ -1846,7 +1860,7 @@
)
{
// Remove the exponent part from the string.
- exp = boost::lexical_cast<boost::int64_t>(static_cast<const char*>(str.c_str() + (pos + 1u)));
+ exp = boost::lexical_cast<ExponentType>(static_cast<const char*>(str.c_str() + (pos + 1u)));
str = str.substr(static_cast<std::size_t>(0u), pos);
}
@@ -1903,7 +1917,7 @@
}
}
- // Put the input string into the standard cpp_dec_float<Digits10> input form
+ // Put the input string into the standard cpp_dec_float<Digits10, ExponentType, Allocator> input form
// aaa.bbbbE+/-n, where aaa has 1...cpp_dec_float_elem_digits10, bbbb has an
// even multiple of cpp_dec_float_elem_digits10 which are possibly zero padded
// on the right-end, and n is a signed 64-bit integer which is an
@@ -1948,7 +1962,7 @@
// Bring one single digit into the mantissa and adjust the exponent accordingly.
str.erase(str.begin(), it_non_zero);
str.insert(static_cast<std::size_t>(1u), ".");
- exp -= static_cast<boost::int64_t>(delta_exp + 1u);
+ exp -= static_cast<ExponentType>(delta_exp + 1u);
}
}
else
@@ -1959,11 +1973,11 @@
// Shift the decimal point such that the exponent is an even multiple of cpp_dec_float_elem_digits10.
std::size_t n_shift = static_cast<std::size_t>(0u);
- const std::size_t n_exp_rem = static_cast<std::size_t>(exp % static_cast<boost::int64_t>(cpp_dec_float_elem_digits10));
+ const std::size_t n_exp_rem = static_cast<std::size_t>(exp % static_cast<ExponentType>(cpp_dec_float_elem_digits10));
- if((exp % static_cast<boost::int64_t>(cpp_dec_float_elem_digits10)) != static_cast<boost::int64_t>(0))
+ if((exp % static_cast<ExponentType>(cpp_dec_float_elem_digits10)) != static_cast<ExponentType>(0))
{
- n_shift = ((exp < static_cast<boost::int64_t>(0))
+ n_shift = ((exp < static_cast<ExponentType>(0))
? static_cast<std::size_t>(n_exp_rem + static_cast<std::size_t>(cpp_dec_float_elem_digits10))
: static_cast<std::size_t>(n_exp_rem));
}
@@ -1987,7 +2001,7 @@
str.erase(pos, static_cast<std::size_t>(1u));
- exp -= static_cast<boost::int64_t>(n_shift);
+ exp -= static_cast<ExponentType>(n_shift);
}
// Cut the size of the mantissa to <= cpp_dec_float_elem_digits10.
@@ -2004,7 +2018,7 @@
str.erase(pos_plus_one, static_cast<std::size_t>(1u));
- exp += static_cast<boost::int64_t>(static_cast<boost::int64_t>(n) * static_cast<boost::int64_t>(cpp_dec_float_elem_digits10));
+ exp += static_cast<ExponentType>(static_cast<ExponentType>(n) * static_cast<ExponentType>(cpp_dec_float_elem_digits10));
}
// Pad the decimal part such that its value is an even
@@ -2031,7 +2045,7 @@
static_cast<std::size_t>(pos_plus_one + max_dec));
}
- // Now the input string has the standard cpp_dec_float<Digits10> input form.
+ // Now the input string has the standard cpp_dec_float<Digits10, ExponentType, Allocator> input form.
// (See the comment above.)
// Set all the data elements to 0.
@@ -2070,9 +2084,9 @@
if(exp == cpp_dec_float_min_exp10)
{
// Check for identity with the minimum value.
- cpp_dec_float<Digits10> test = *this;
+ cpp_dec_float<Digits10, ExponentType, Allocator> test = *this;
- test.exp = static_cast<boost::int64_t>(0);
+ test.exp = static_cast<ExponentType>(0);
if(test.isone())
{
@@ -2098,15 +2112,15 @@
return true;
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>::cpp_dec_float(const double mantissa, const long long exponent) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float(const double mantissa, const ExponentType exponent) BOOST_NOEXCEPT
: data (),
- exp (static_cast<boost::int64_t>(0)),
+ exp (static_cast<ExponentType>(0)),
neg (false),
fpclass (cpp_dec_float_finite),
prec_elem(cpp_dec_float_elem_number)
{
- // Create *this cpp_dec_float<Digits10> from a given mantissa and exponent.
+ // Create *this cpp_dec_float<Digits10, ExponentType, Allocator> from a given mantissa and exponent.
// Note: This constructor does not maintain the full precision of double.
const bool mantissa_is_iszero = (::fabs(mantissa) < ((std::numeric_limits<double>::min)() * (1.0 + std::numeric_limits<double>::epsilon())));
@@ -2120,7 +2134,7 @@
const bool b_neg = (mantissa < 0.0);
double d = ((!b_neg) ? mantissa : -mantissa);
- boost::int64_t e = exponent;
+ ExponentType e = exponent;
while(d > 10.0) { d /= 10.0; ++e; }
while(d < 1.0) { d *= 10.0; --e; }
@@ -2150,8 +2164,8 @@
}
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10>& cpp_dec_float<Digits10>::operator = (long double a) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator = (long double a) BOOST_NOEXCEPT
{
// Christopher Kormanyos's original code used a cast to long long here, but that fails
// when long double has more digits than a long long.
@@ -2200,12 +2214,12 @@
return *this;
}
-template <unsigned Digits10>
-void cpp_dec_float<Digits10>::from_unsigned_long_long(const unsigned long long u) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+void cpp_dec_float<Digits10, ExponentType, Allocator>::from_unsigned_long_long(const unsigned long long u) BOOST_NOEXCEPT
{
std::fill(data.begin(), data.end(), static_cast<boost::uint32_t>(0u));
- exp = static_cast<boost::int64_t>(0);
+ exp = static_cast<ExponentType>(0);
neg = false;
fpclass = cpp_dec_float_finite;
prec_elem = cpp_dec_float_elem_number;
@@ -2225,15 +2239,15 @@
if(i > static_cast<std::size_t>(1u))
{
- exp += static_cast<boost::int64_t>((i - 1u) * static_cast<std::size_t>(cpp_dec_float_elem_digits10));
+ exp += static_cast<ExponentType>((i - 1u) * static_cast<std::size_t>(cpp_dec_float_elem_digits10));
}
std::reverse(temp, temp + i);
std::copy(temp, temp + (std::min)(i, static_cast<std::size_t>(cpp_dec_float_elem_number)), data.begin());
}
-template <unsigned Digits10>
-boost::uint32_t cpp_dec_float<Digits10>::mul_loop_uv(boost::uint32_t* const u, const boost::uint32_t* const v, const boost::int32_t p) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+boost::uint32_t cpp_dec_float<Digits10, ExponentType, Allocator>::mul_loop_uv(boost::uint32_t* const u, const boost::uint32_t* const v, const boost::int32_t p) BOOST_NOEXCEPT
{
//
// There is a limit on how many limbs this algorithm can handle without dropping digits
@@ -2261,8 +2275,8 @@
return static_cast<boost::uint32_t>(carry);
}
-template <unsigned Digits10>
-boost::uint32_t cpp_dec_float<Digits10>::mul_loop_n(boost::uint32_t* const u, boost::uint32_t n, const boost::int32_t p) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+boost::uint32_t cpp_dec_float<Digits10, ExponentType, Allocator>::mul_loop_n(boost::uint32_t* const u, boost::uint32_t n, const boost::int32_t p) BOOST_NOEXCEPT
{
boost::uint64_t carry = static_cast<boost::uint64_t>(0u);
@@ -2277,8 +2291,8 @@
return static_cast<boost::uint32_t>(carry);
}
-template <unsigned Digits10>
-boost::uint32_t cpp_dec_float<Digits10>::div_loop_n(boost::uint32_t* const u, boost::uint32_t n, const boost::int32_t p) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+boost::uint32_t cpp_dec_float<Digits10, ExponentType, Allocator>::div_loop_n(boost::uint32_t* const u, boost::uint32_t n, const boost::int32_t p) BOOST_NOEXCEPT
{
boost::uint64_t prev = static_cast<boost::uint64_t>(0u);
@@ -2292,14 +2306,14 @@
return static_cast<boost::uint32_t>(prev);
}
-template <unsigned Digits10>
-cpp_dec_float<Digits10> cpp_dec_float<Digits10>::pow2(const long long p) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+cpp_dec_float<Digits10, ExponentType, Allocator> cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(const long long p) BOOST_NOEXCEPT
{
// Create a static const table of p^2 for -128 < p < +128.
// Note: The size of this table must be odd-numbered and
// symmetric about 0.
init.do_nothing();
- static const boost::array<cpp_dec_float<Digits10>, 255u> p2_data =
+ static const boost::array<cpp_dec_float<Digits10, ExponentType, Allocator>, 255u> p2_data =
{{
cpp_dec_float("5.877471754111437539843682686111228389093327783860437607543758531392086297273635864257812500000000000e-39"),
cpp_dec_float("1.175494350822287507968736537222245677818665556772087521508751706278417259454727172851562500000000000e-38"),
@@ -2558,90 +2572,90 @@
cpp_dec_float("1.701411834604692317316873037158841057280000000000000000000000000000000000000000000000000000000000000e38")
}};
- if((p > static_cast<boost::int64_t>(-128)) && (p < static_cast<boost::int64_t>(+128)))
+ if((p > static_cast<ExponentType>(-128)) && (p < static_cast<ExponentType>(+128)))
{
return p2_data[static_cast<std::size_t>(p + ((p2_data.size() - 1u) / 2u))];
}
// Compute and return 2^p.
- if(p < static_cast<boost::int64_t>(0))
+ if(p < static_cast<ExponentType>(0))
{
- return pow2(static_cast<boost::int64_t>(-p)).calculate_inv();
+ return pow2(static_cast<ExponentType>(-p)).calculate_inv();
}
- else if(p < static_cast<boost::int64_t>(std::numeric_limits<boost::uint64_t>::digits))
+ else if(p < static_cast<ExponentType>(std::numeric_limits<boost::uint64_t>::digits))
{
const boost::uint64_t p2 = static_cast<boost::uint64_t>(static_cast<boost::uint64_t>(1uLL) << p);
return cpp_dec_float(p2);
}
else
{
- cpp_dec_float<Digits10> t;
+ cpp_dec_float<Digits10, ExponentType, Allocator> t;
default_ops::detail::pow_imp(t, two(), p, mpl::true_());
return t;
}
}
-template <unsigned Digits10>
-inline void eval_add(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_add(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& o) BOOST_NOEXCEPT
{
result += o;
}
-template <unsigned Digits10>
-inline void eval_subtract(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_subtract(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& o) BOOST_NOEXCEPT
{
result -= o;
}
-template <unsigned Digits10>
-inline void eval_multiply(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_multiply(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& o) BOOST_NOEXCEPT
{
result *= o;
}
-template <unsigned Digits10>
-inline void eval_divide(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_divide(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& o) BOOST_NOEXCEPT
{
result /= o;
}
-template <unsigned Digits10>
-inline void eval_add(cpp_dec_float<Digits10>& result, const unsigned long long& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_add(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const unsigned long long& o) BOOST_NOEXCEPT
{
result.add_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_subtract(cpp_dec_float<Digits10>& result, const unsigned long long& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_subtract(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const unsigned long long& o) BOOST_NOEXCEPT
{
result.sub_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_multiply(cpp_dec_float<Digits10>& result, const unsigned long long& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_multiply(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const unsigned long long& o) BOOST_NOEXCEPT
{
result.mul_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_divide(cpp_dec_float<Digits10>& result, const unsigned long long& o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_divide(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const unsigned long long& o) BOOST_NOEXCEPT
{
result.div_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_add(cpp_dec_float<Digits10>& result, long long o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_add(cpp_dec_float<Digits10, ExponentType, Allocator>& result, long long o) BOOST_NOEXCEPT
{
if(o < 0)
result.sub_unsigned_long_long(-o);
else
result.add_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_subtract(cpp_dec_float<Digits10>& result, long long o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_subtract(cpp_dec_float<Digits10, ExponentType, Allocator>& result, long long o) BOOST_NOEXCEPT
{
if(o < 0)
result.add_unsigned_long_long(-o);
else
result.sub_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_multiply(cpp_dec_float<Digits10>& result, long long o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_multiply(cpp_dec_float<Digits10, ExponentType, Allocator>& result, long long o) BOOST_NOEXCEPT
{
if(o < 0)
{
@@ -2651,8 +2665,8 @@
else
result.mul_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_divide(cpp_dec_float<Digits10>& result, long long o) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_divide(cpp_dec_float<Digits10, ExponentType, Allocator>& result, long long o) BOOST_NOEXCEPT
{
if(o < 0)
{
@@ -2663,18 +2677,18 @@
result.div_unsigned_long_long(o);
}
-template <unsigned Digits10>
-inline void eval_convert_to(unsigned long long* result, const cpp_dec_float<Digits10>& val) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_convert_to(unsigned long long* result, const cpp_dec_float<Digits10, ExponentType, Allocator>& val) BOOST_NOEXCEPT
{
*result = val.extract_unsigned_long_long();
}
-template <unsigned Digits10>
-inline void eval_convert_to(long long* result, const cpp_dec_float<Digits10>& val) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_convert_to(long long* result, const cpp_dec_float<Digits10, ExponentType, Allocator>& val) BOOST_NOEXCEPT
{
*result = val.extract_signed_long_long();
}
-template <unsigned Digits10>
-inline void eval_convert_to(long double* result, cpp_dec_float<Digits10>& val) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_convert_to(long double* result, cpp_dec_float<Digits10, ExponentType, Allocator>& val) BOOST_NOEXCEPT
{
*result = val.extract_long_double();
}
@@ -2682,8 +2696,8 @@
//
// Non member function support:
//
-template <unsigned Digits10>
-inline int eval_fpclassify(const cpp_dec_float<Digits10>& x) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline int eval_fpclassify(const cpp_dec_float<Digits10, ExponentType, Allocator>& x) BOOST_NOEXCEPT
{
if(x.isinf())
return FP_INFINITE;
@@ -2694,31 +2708,31 @@
return FP_NORMAL;
}
-template <unsigned Digits10>
-inline void eval_abs(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_abs(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) BOOST_NOEXCEPT
{
result = x;
if(x.isneg())
result.negate();
}
-template <unsigned Digits10>
-inline void eval_fabs(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_fabs(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) BOOST_NOEXCEPT
{
result = x;
if(x.isneg())
result.negate();
}
-template <unsigned Digits10>
-inline void eval_sqrt(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_sqrt(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) BOOST_NOEXCEPT
{
result = x;
result.calculate_sqrt();
}
-template <unsigned Digits10>
-inline void eval_floor(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_floor(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) BOOST_NOEXCEPT
{
result = x;
if(!x.isfinite() || x.isint())
@@ -2727,12 +2741,12 @@
}
if(x.isneg())
- result -= cpp_dec_float<Digits10>::one();
+ result -= cpp_dec_float<Digits10, ExponentType, Allocator>::one();
result = result.extract_integer_part();
}
-template <unsigned Digits10>
-inline void eval_ceil(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_ceil(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) BOOST_NOEXCEPT
{
result = x;
if(!x.isfinite() || x.isint())
@@ -2741,16 +2755,16 @@
}
if(!x.isneg())
- result += cpp_dec_float<Digits10>::one();
+ result += cpp_dec_float<Digits10, ExponentType, Allocator>::one();
result = result.extract_integer_part();
}
-template <unsigned Digits10>
-inline void eval_trunc(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x)
+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())
{
- result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number<cpp_dec_float<Digits10> >(x), 0, boost::math::policies::policy<>()).backend();
+ result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number<cpp_dec_float<Digits10, ExponentType, Allocator> >(x), 0, boost::math::policies::policy<>()).backend();
return;
}
else if(x.isint())
@@ -2761,15 +2775,17 @@
result = x.extract_integer_part();
}
-template <unsigned Digits10>
-inline void eval_ldexp(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x, long long e) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator, class ArgType>
+inline void eval_ldexp(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x, ArgType e) BOOST_NOEXCEPT
{
+ if((static_cast<long long>(e) > (std::numeric_limits<ExponentType>::max)()) || (static_cast<long long>(e) < (std::numeric_limits<ExponentType>::min)()))
+ BOOST_THROW_EXCEPTION(std::runtime_error(std::string("Exponent value is out of range.")));
result = x;
- result *= cpp_dec_float<Digits10>::pow2(e);
+ result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(e);
}
-template <unsigned Digits10>
-inline void eval_frexp(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x, long long* e)
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline void eval_frexp(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x, ExponentType* e)
{
result = x;
if(result.isneg())
@@ -2781,9 +2797,9 @@
return;
}
- long long t = result.order();
+ ExponentType t = result.order();
BOOST_MP_USING_ABS
- if(abs(t) < ((std::numeric_limits<long long>::max)() / 1000))
+ if(abs(t) < ((std::numeric_limits<ExponentType>::max)() / 1000))
{
t *= 1000;
t /= 301;
@@ -2794,7 +2810,7 @@
t *= 1000;
}
- result *= cpp_dec_float<Digits10>::pow2(-t);
+ result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t);
if(result.iszero() || result.isinf() || result.isnan())
{
@@ -2803,32 +2819,32 @@
if(result.isneg())
result.negate();
t /= 2;
- result *= cpp_dec_float<Digits10>::pow2(-t);
+ result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t);
}
BOOST_MP_USING_ABS
if(abs(result.order()) > 5)
{
// If our first estimate doesn't get close enough then try recursion until we do:
- long long e2;
- cpp_dec_float<Digits10> r2;
+ ExponentType e2;
+ cpp_dec_float<Digits10, ExponentType, Allocator> r2;
eval_frexp(r2, result, &e2);
// overflow protection:
- if((t > 0) && (e2 > 0) && (t > (std::numeric_limits<long long>::max)() - e2))
+ if((t > 0) && (e2 > 0) && (t > (std::numeric_limits<ExponentType>::max)() - e2))
BOOST_THROW_EXCEPTION(std::runtime_error("Exponent is too large to be represented as a power of 2."));
- if((t < 0) && (e2 < 0) && (t < (std::numeric_limits<long long>::min)() - e2))
+ if((t < 0) && (e2 < 0) && (t < (std::numeric_limits<ExponentType>::min)() - e2))
BOOST_THROW_EXCEPTION(std::runtime_error("Exponent is too large to be represented as a power of 2."));
t += e2;
result = r2;
}
- while(result.compare(cpp_dec_float<Digits10>::one()) >= 0)
+ while(result.compare(cpp_dec_float<Digits10, ExponentType, Allocator>::one()) >= 0)
{
- result /= cpp_dec_float<Digits10>::two();
+ result /= cpp_dec_float<Digits10, ExponentType, Allocator>::two();
++t;
}
- while(result.compare(cpp_dec_float<Digits10>::half()) < 0)
+ while(result.compare(cpp_dec_float<Digits10, ExponentType, Allocator>::half()) < 0)
{
- result *= cpp_dec_float<Digits10>::two();
+ result *= cpp_dec_float<Digits10, ExponentType, Allocator>::two();
--t;
}
*e = t;
@@ -2836,23 +2852,23 @@
result.negate();
}
-template <unsigned Digits10>
-inline void eval_frexp(cpp_dec_float<Digits10>& result, const cpp_dec_float<Digits10>& x, int* e)
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline typename disable_if<is_same<ExponentType, int> >::type eval_frexp(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x, int* e)
{
- long long t;
+ ExponentType t;
eval_frexp(result, x, &t);
- if(t > (std::numeric_limits<int>::max)())
+ if((t > (std::numeric_limits<int>::max)()) || (t < (std::numeric_limits<int>::min)()))
BOOST_THROW_EXCEPTION(std::runtime_error("Exponent is outside the range of an int"));
*e = static_cast<int>(t);
}
-template <unsigned Digits10>
-inline bool eval_is_zero(const cpp_dec_float<Digits10>& val) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline bool eval_is_zero(const cpp_dec_float<Digits10, ExponentType, Allocator>& val) BOOST_NOEXCEPT
{
return val.iszero();
}
-template <unsigned Digits10>
-inline int eval_get_sign(const cpp_dec_float<Digits10>& val) BOOST_NOEXCEPT
+template <unsigned Digits10, class ExponentType, class Allocator>
+inline int eval_get_sign(const cpp_dec_float<Digits10, ExponentType, Allocator>& val) BOOST_NOEXCEPT
{
return val.iszero() ? 0 : val.isneg() ? -1 : 1;
}
@@ -2869,8 +2885,8 @@
namespace detail{
-template<unsigned D1, unsigned D2>
-struct is_explicitly_convertible<cpp_dec_float<D1>, cpp_dec_float<D2> > : public mpl::true_ {};
+template<unsigned D1, class E1, class A1, unsigned D2, class E2, class A2>
+struct is_explicitly_convertible<cpp_dec_float<D1, E1, A1>, cpp_dec_float<D2, E2, A2> > : public mpl::true_ {};
}
@@ -2881,8 +2897,8 @@
namespace std
{
- template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
- class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >
+ template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+ class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >
{
public:
BOOST_STATIC_CONSTEXPR bool is_specialized = true;
@@ -2892,14 +2908,14 @@
BOOST_STATIC_CONSTEXPR bool is_bounded = true;
BOOST_STATIC_CONSTEXPR bool is_modulo = false;
BOOST_STATIC_CONSTEXPR bool is_iec559 = false;
- BOOST_STATIC_CONSTEXPR int digits = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_digits10;
- BOOST_STATIC_CONSTEXPR int digits10 = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_digits10;
- BOOST_STATIC_CONSTEXPR int max_digits10 = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_total_digits10;
- BOOST_STATIC_CONSTEXPR boost::int64_t min_exponent = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_min_exp; // Type differs from int.
- BOOST_STATIC_CONSTEXPR boost::int64_t min_exponent10 = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_min_exp10; // Type differs from int.
- BOOST_STATIC_CONSTEXPR boost::int64_t max_exponent = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_max_exp; // Type differs from int.
- BOOST_STATIC_CONSTEXPR boost::int64_t max_exponent10 = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_max_exp10; // Type differs from int.
- BOOST_STATIC_CONSTEXPR int radix = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_radix;
+ BOOST_STATIC_CONSTEXPR int digits = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10;
+ BOOST_STATIC_CONSTEXPR int digits10 = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10;
+ BOOST_STATIC_CONSTEXPR int max_digits10 = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_total_digits10;
+ BOOST_STATIC_CONSTEXPR ExponentType min_exponent = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_min_exp; // Type differs from int.
+ BOOST_STATIC_CONSTEXPR ExponentType min_exponent10 = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_min_exp10; // Type differs from int.
+ BOOST_STATIC_CONSTEXPR ExponentType max_exponent = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_max_exp; // Type differs from int.
+ BOOST_STATIC_CONSTEXPR ExponentType max_exponent10 = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_max_exp10; // Type differs from int.
+ BOOST_STATIC_CONSTEXPR int radix = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_radix;
BOOST_STATIC_CONSTEXPR std::float_round_style round_style = std::round_to_nearest;
BOOST_STATIC_CONSTEXPR bool has_infinity = true;
BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = true;
@@ -2909,63 +2925,63 @@
BOOST_STATIC_CONSTEXPR bool traps = false;
BOOST_STATIC_CONSTEXPR bool tinyness_before = false;
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> (min) (void) { return (boost::multiprecision::cpp_dec_float<Digits10>::min)(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> (max) (void) { return (boost::multiprecision::cpp_dec_float<Digits10>::max)(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> lowest (void) { return boost::multiprecision::cpp_dec_float<Digits10>::zero(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> epsilon (void) { return boost::multiprecision::cpp_dec_float<Digits10>::eps(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> round_error (void) { return 0.5L; }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> infinity (void) { return boost::multiprecision::cpp_dec_float<Digits10>::inf(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> quiet_NaN (void) { return boost::multiprecision::cpp_dec_float<Digits10>::nan(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> signaling_NaN(void) { return boost::multiprecision::cpp_dec_float<Digits10>::zero(); }
- BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> denorm_min (void) { return boost::multiprecision::cpp_dec_float<Digits10>::zero(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> (min) (void) { return (boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::min)(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> (max) (void) { return (boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::max)(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> lowest (void) { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::zero(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> epsilon (void) { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::eps(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> round_error (void) { return 0.5L; }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> infinity (void) { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::inf(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> quiet_NaN (void) { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::nan(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> signaling_NaN(void) { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::zero(); }
+ BOOST_STATIC_CONSTEXPR boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> denorm_min (void) { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::zero(); }
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::digits;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::digits10;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::max_digits10;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::is_signed;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::is_integer;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::is_exact;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::radix;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::min_exponent;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::min_exponent10;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::max_exponent;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::max_exponent10;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::has_infinity;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::has_quiet_NaN;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::has_signaling_NaN;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::has_denorm;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::has_denorm_loss;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::is_iec559;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::is_bounded;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::is_modulo;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::traps;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::tinyness_before;
-template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
-BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates> >::round_style;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::digits;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::digits10;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::max_digits10;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::is_signed;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::is_integer;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::is_exact;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::radix;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST ExponentType numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::min_exponent;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST ExponentType numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::min_exponent10;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST ExponentType numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::max_exponent;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST ExponentType numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::max_exponent10;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_infinity;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_quiet_NaN;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_signaling_NaN;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_denorm;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_denorm_loss;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::is_iec559;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::is_bounded;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::is_modulo;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::traps;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::tinyness_before;
+template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::round_style;
#endif
}
@@ -2974,12 +2990,12 @@
namespace policies{
-template <unsigned Digits10, class Policy, boost::multiprecision::expression_template_option ExpressionTemplates>
-struct precision< boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10>, ExpressionTemplates>, Policy>
+template <unsigned Digits10, class ExponentType, class Allocator, class Policy, boost::multiprecision::expression_template_option ExpressionTemplates>
+struct precision< boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates>, Policy>
{
// Define a local copy of cpp_dec_float_digits10 because it might differ
// from the template parameter Digits10 for small or large digit counts.
- static const boost::int32_t cpp_dec_float_digits10 = boost::multiprecision::cpp_dec_float<Digits10>::cpp_dec_float_digits10;
+ static const boost::int32_t cpp_dec_float_digits10 = boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_digits10;
typedef typename Policy::precision_type precision_type;
typedef digits2<((cpp_dec_float_digits10 + 1LL) * 1000LL) / 301LL> digits_2;
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-09-07 04:31:49 EDT (Fri, 07 Sep 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 id955783">
+<div class="section id950395">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id955783"></a>Function Index</h3></div></div></div>
+<a name="id950395"></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>
@@ -55,10 +55,16 @@
<dt>
<a name="idx_id_2"></a><span class="term">C</span>
</dt>
-<dd><div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none">
+<dd><div class="index"><ul class="index" style="list-style-type: none; ">
+<li class="listitem" style="list-style-type: none">
<p><span class="index-entry-level-0">compare</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></ul></div></dd>
+</li>
+<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">cpp_dec_float</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="../map/todo.html" title="TODO"><span class="index-entry-level-1">TODO</span></a></p></li></ul></div>
+</li>
+</ul></div></dd>
<dt>
<a name="idx_id_3"></a><span class="term">D</span>
</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-09-07 04:31:49 EDT (Fri, 07 Sep 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 id958282">
+<div class="section id954388">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id958282"></a>Class Index</h3></div></div></div>
+<a name="id954388"></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>
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-09-07 04:31:49 EDT (Fri, 07 Sep 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 id958626">
+<div class="section id954732">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id958626"></a>Typedef Index</h3></div></div></div>
+<a name="id954732"></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-09-07 04:31:49 EDT (Fri, 07 Sep 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 id961546">
+<div class="section id955466">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id961546"></a>Index</h3></div></div></div>
+<a name="id955466"></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>
@@ -98,6 +98,7 @@
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../tut/floats/cpp_dec_float.html" title="cpp_dec_float"><span class="index-entry-level-1">cpp_dec_float</span></a></strong></span></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../tut/floats/cpp_dec_float.html" title="cpp_dec_float"><span class="index-entry-level-1">cpp_dec_float_100</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../tut/floats/cpp_dec_float.html" title="cpp_dec_float"><span class="index-entry-level-1">cpp_dec_float_50</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../map/todo.html" title="TODO"><span class="index-entry-level-1">TODO</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -817,6 +818,10 @@
</dt>
<dd><div class="index"><ul class="index" style="list-style-type: none; ">
<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">TODO</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="../map/todo.html" title="TODO"><span class="index-entry-level-1">cpp_dec_float</span></a></p></li></ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
<p><span class="index-entry-level-0">tommath_int</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="../tut/ints/tom_int.html" title="tom_int"><span class="index-entry-level-1">tom_int</span></a></p></li></ul></div>
</li>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -37,6 +37,13 @@
<li class="listitem">
Removed "mp_" prefix from types.
</li>
+<li class="listitem">
+ Allowed mixed precision arithmetic.
+ </li>
+<li class="listitem">
+ Changed ExpressionTemplates parameter to class <code class="computeroutput"><span class="identifier">number</span></code>
+ to use enumerated values rather than true/false.
+ </li>
</ul></div>
<h5>
<a name="boost_multiprecision.map.hist.h1"></a>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -54,7 +54,7 @@
<li class="listitem">
Make the exponent type for cpp_dec_float a templare parameter, maybe
include support for big-integer exponents. Open question - what should
- be the default - int32_t or int64_t?
+ be the default - int32_t or int64_t? (done 2012/09/06)
</li>
<li class="listitem">
Document the size requirements of fixed precision ints.
@@ -76,19 +76,21 @@
- min == -max etc.
</li>
<li class="listitem">
- Document cpp_dec_float precision, rounding, and exponent size.
+ Document cpp_dec_float precision, rounding, and exponent size (done 2012/09/06).
</li>
<li class="listitem">
- Can we be clearer in the docs that mixed arithmetic doesn't work?
+ Can we be clearer in the docs that mixed arithmetic doesn't work (no
+ longer applicable as of 2012/09/06)?
</li>
<li class="listitem">
- Document round functions behaviour better (they behave as in C99).
+ Document round functions behaviour better (they behave as in C++11) (added
+ note 2012/09/06).
</li>
<li class="listitem">
Should there be a choice of rounding mode (probably MPFR specific)?
</li>
<li class="listitem">
- Document limits on size of cpp_dec_float.
+ Document limits on size of cpp_dec_float (done 2012/09/06).
</li>
</ul></div>
</div>
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-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -580,7 +580,7 @@
<span class="emphasis"><em>unmentionable-expression-template-type</em></span> <span class="identifier">atan2</span> <span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>number-or-expression-template-type</em></span><span class="special">&,</span> <span class="keyword">const</span> <span class="emphasis"><em>number-or-expression-template-type</em></span><span class="special">&);</span>
</pre>
<p>
- These functions all behave exactly as their standard library counterparts
+ These functions all behave exactly as their standard library C++11 counterparts
do: their argument is either an instance of <code class="computeroutput"><span class="identifier">number</span></code>
or an expression template derived from it; If the argument is of type <code class="computeroutput"><span class="identifier">number</span><span class="special"><</span><span class="identifier">Backend</span><span class="special">,</span> <span class="identifier">et_off</span><span class="special">></span></code>
then that is also the return type, otherwise the return type is an expression
@@ -601,6 +601,317 @@
library later, then these functions may be extended to support those number
types).
</p>
+<p>
+ The precision of these functions is generally deterimined by the backend
+ implementation. For example the precision of these functions when used with
+ <a class="link" href="../tut/floats/mpfr_float.html" title="mpfr_float">mpfr_float</a>
+ is determined entirely by MPFR.
+ When these functions use our own implementations, the accuracy of the transcendal
+ functions is generally a few epsilon. Note however, that the trigonmetrical
+ functions incur the usual accuracy loss when reducing arguments by large
+ multiples of π. Also note that both __mpf_float and <a class="link" href="../tut/floats/cpp_dec_float.html" title="cpp_dec_float">cpp_dec_float</a>
+ have a number of guard digits beyond their stated precision, so the error
+ rates listed for these are in some sense artificially low.
+ </p>
+<p>
+ The following table shows the error rates we observe for these functions
+ with various backend types, functions not listed here are exact (tested on
+ Win32 with VC++10, MPFR-3.0.0, MPIR-2.1.1):
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Function
+ </p>
+ </th>
+<th>
+ <p>
+ mpfr_float_50
+ </p>
+ </th>
+<th>
+ <p>
+ mpf_float_50
+ </p>
+ </th>
+<th>
+ <p>
+ cpp_dec_float_50
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ sqrt
+ </p>
+ </td>
+<td>
+ <p>
+ 1eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ exp
+ </p>
+ </td>
+<td>
+ <p>
+ 1eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ log
+ </p>
+ </td>
+<td>
+ <p>
+ 1eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ log10
+ </p>
+ </td>
+<td>
+ <p>
+ 1eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cos
+ </p>
+ </td>
+<td>
+ <p>
+ 700eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ sin
+ </p>
+ </td>
+<td>
+ <p>
+ 1eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+<td>
+ <p>
+ 0eps
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ tan
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ acos
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ asin
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ atan
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cosh
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ sinh
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ tanh
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ pow
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ fmod
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ atan2
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+<td>
+ </td>
+</tr>
+</tbody>
+</table></div>
<h5>
<a name="boost_multiprecision.ref.number.h6"></a>
<span class="phrase"><a name="boost_multiprecision.ref.number.traits_class_support"></a></span><a class="link" href="number.html#boost_multiprecision.ref.number.traits_class_support">Traits Class
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -31,9 +31,9 @@
</dl></dd>
<dt><span class="section">Floating Point Numbers</span></dt>
<dd><dl>
+<dt><span class="section">cpp_dec_float</span></dt>
<dt><span class="section">gmp_float</span></dt>
<dt><span class="section">mpfr_float</span></dt>
-<dt><span class="section">cpp_dec_float</span></dt>
<dt><span class="section">Examples</span></dt>
<dd><dl>
<dt><span class="section"><a href="tut/floats/fp_eg/aos.html">Area of
@@ -50,8 +50,8 @@
</dl></dd>
<dt><span class="section">Rational Number Types</span></dt>
<dd><dl>
-<dt><span class="section">gmp_rational</span></dt>
<dt><span class="section">cpp_rational</span></dt>
+<dt><span class="section">gmp_rational</span></dt>
<dt><span class="section">tommath_rational</span></dt>
<dt><span class="section">Use With Boost.Rational</span></dt>
<dt><span class="section">rational_adapter</span></dt>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -7,20 +7,20 @@
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../tut.html" title="Tutorial">
<link rel="prev" href="ints/egs/bitops.html" title="Bit Operations">
-<link rel="next" href="floats/gmp_float.html" title="gmp_float">
+<link rel="next" href="floats/cpp_dec_float.html" title="cpp_dec_float">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="ints/egs/bitops.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="floats/gmp_float.html"><img src="../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="ints/egs/bitops.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="floats/cpp_dec_float.html"><img src="../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_floats">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_multiprecision.tut.floats"></a><a class="link" href="floats.html" title="Floating Point Numbers">Floating Point Numbers</a>
</h3></div></div></div>
<div class="toc"><dl>
+<dt><span class="section">cpp_dec_float</span></dt>
<dt><span class="section">gmp_float</span></dt>
<dt><span class="section">mpfr_float</span></dt>
-<dt><span class="section">cpp_dec_float</span></dt>
<dt><span class="section">Examples</span></dt>
<dd><dl>
<dt><span class="section"><a href="floats/fp_eg/aos.html">Area of
@@ -83,45 +83,45 @@
<tr>
<td>
<p>
- <code class="computeroutput"><span class="identifier">mpf_float</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span></code>
+ <code class="computeroutput"><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span></code>
</p>
</td>
<td>
<p>
- boost/multiprecision/gmp.hpp
+ boost/multiprecision/cpp_dec_float.hpp
</p>
</td>
<td>
<p>
- 2
+ 10
</p>
</td>
<td>
<p>
- GMP
+ None
</p>
</td>
<td>
<p>
- Very fast and efficient back-end.
+ Header only, all C++ implementation. Boost licence.
</p>
</td>
<td>
<p>
- Dependency on GNU licensed GMP
- library.
+ Approximately 2x slower than the MPFR
+ or GMP libraries.
</p>
</td>
</tr>
<tr>
<td>
<p>
- <code class="computeroutput"><span class="identifier">mpfr_float</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span></code>
+ <code class="computeroutput"><span class="identifier">mpf_float</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span></code>
</p>
</td>
<td>
<p>
- boost/multiprecision/mpfr.hpp
+ boost/multiprecision/gmp.hpp
</p>
</td>
<td>
@@ -131,52 +131,52 @@
</td>
<td>
<p>
- GMP and MPFR
+ GMP
</p>
</td>
<td>
<p>
- Very fast and efficient back-end, with its own standard library
- implementation.
+ Very fast and efficient back-end.
</p>
</td>
<td>
<p>
Dependency on GNU licensed GMP
- and MPFR libraries.
+ library.
</p>
</td>
</tr>
<tr>
<td>
<p>
- <code class="computeroutput"><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span></code>
+ <code class="computeroutput"><span class="identifier">mpfr_float</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span></code>
</p>
</td>
<td>
<p>
- boost/multiprecision/cpp_dec_float.hpp
+ boost/multiprecision/mpfr.hpp
</p>
</td>
<td>
<p>
- 10
+ 2
</p>
</td>
<td>
<p>
- None
+ GMP and MPFR
</p>
</td>
<td>
<p>
- Header only, all C++ implementation. Boost licence.
+ Very fast and efficient back-end, with its own standard library
+ implementation.
</p>
</td>
<td>
<p>
- Approximately 2x slower than the MPFR
- or GMP libraries.
+ Dependency on GNU licensed GMP
+ and MPFR libraries.
</p>
</td>
</tr>
@@ -193,7 +193,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="ints/egs/bitops.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="floats/gmp_float.html"><img src="../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="ints/egs/bitops.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="floats/cpp_dec_float.html"><img src="../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -6,12 +6,12 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../floats.html" title="Floating Point Numbers">
-<link rel="prev" href="mpfr_float.html" title="mpfr_float">
-<link rel="next" href="fp_eg.html" title="Examples">
+<link rel="prev" href="../floats.html" title="Floating Point Numbers">
+<link rel="next" href="gmp_float.html" title="gmp_float">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="mpfr_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="../floats.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="gmp_float.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_floats_cpp_dec_float">
<div class="titlepage"><div><div><h4 class="title">
@@ -22,7 +22,7 @@
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">multiprecision</span><span class="special">{</span>
-<span class="keyword">template</span> <span class="special"><</span><span class="keyword">unsigned</span> <span class="identifier">Digits10</span><span class="special">></span>
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">unsigned</span> <span class="identifier">Digits10</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">ExponentType</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">int32_t</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">></span>
<span class="keyword">class</span> <span class="identifier">cpp_dec_float</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">number</span><span class="special"><</span><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="number">50</span><span class="special">></span> <span class="special">></span> <span class="identifier">cpp_dec_float_50</span><span class="special">;</span>
@@ -42,7 +42,27 @@
be used at fixed precision by specifying a non-zero <code class="computeroutput"><span class="identifier">Digits10</span></code>
template parameter. The typedefs <code class="computeroutput"><span class="identifier">cpp_dec_float_50</span></code>
and <code class="computeroutput"><span class="identifier">cpp_dec_float_100</span></code> provide
- arithmetic types at 50 and 100 decimal digits precision respectively.
+ arithmetic types at 50 and 100 decimal digits precision respectively. Optionally,
+ you can specify an integer type to use for the exponent, this defaults
+ to a 32-bit integer type which is more than large enough for the vast majority
+ of use cases, but larger types such as <code class="computeroutput"><span class="keyword">long</span>
+ <span class="keyword">long</span></code> can also be specified if you
+ need a truely huge exponent range.
+ </p>
+<p>
+ Normally <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>
+ allocates no memory: all of the space required for it's digits are allocated
+ directly within the class. As a result care should be taken not to use
+ the class with too high a digit count as stack space requirements can grow
+ out of control. If that represents a problem then providing an allocator
+ as the final template parameter causes <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>
+ to dynamically allocate the memory it needs: this significantly reduces
+ the size of <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>
+ and increases the viable upper limit on the number of digits at the expense
+ of performance. However, please bare in mind that arithmetic operations
+ rapidly become <span class="emphasis"><em>very</em></span> expensive as the digit count grows:
+ the current implementation really isn't optimized or designed for large
+ digit counts.
</p>
<p>
There is full standard library and <code class="computeroutput"><span class="identifier">numeric_limits</span></code>
@@ -83,13 +103,25 @@
Any <code class="computeroutput"><span class="identifier">number</span></code> instantiated
on this type, is convertible to any other <code class="computeroutput"><span class="identifier">number</span></code>
instantiated on this type - for example you can convert from <code class="computeroutput"><span class="identifier">number</span><span class="special"><</span><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="number">50</span><span class="special">></span> <span class="special">></span></code> to <code class="computeroutput"><span class="identifier">number</span><span class="special"><</span><span class="identifier">cpp_dec_float</span><span class="special"><</span><span class="identifier">SomeOtherValue</span><span class="special">></span> <span class="special">></span></code>.
- Narrowing conversions are truncating.
+ Narrowing conversions are truncating and <code class="computeroutput"><span class="keyword">explicit</span></code>.
</li>
<li class="listitem">
Conversion from a string results in a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code>
being thrown if the string can not be interpreted as a valid floating
point number.
</li>
+<li class="listitem">
+ The actual precision of a <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>
+ is always slightly higher than the number of digits specified in the
+ template parameter, actually how much higher is an implementation detail
+ but is always at least 8 decimal digits.
+ </li>
+<li class="listitem">
+ Operations involving <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>
+ are always truncating. However, note that since their are guard digits
+ in effect, in practice this has no real impact on accuracy for most
+ use cases.
+ </li>
</ul></div>
<h6>
<a name="boost_multiprecision.tut.floats.cpp_dec_float.h0"></a>
@@ -131,7 +163,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="mpfr_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="../floats.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="gmp_float.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/fp_eg.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/fp_eg.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/fp_eg.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -6,12 +6,12 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../floats.html" title="Floating Point Numbers">
-<link rel="prev" href="cpp_dec_float.html" title="cpp_dec_float">
+<link rel="prev" href="mpfr_float.html" title="mpfr_float">
<link rel="next" href="fp_eg/aos.html" title="Area of Circle">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="cpp_dec_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg/aos.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="mpfr_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg/aos.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_floats_fp_eg">
<div class="titlepage"><div><div><h4 class="title">
@@ -40,7 +40,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="cpp_dec_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg/aos.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="mpfr_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg/aos.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/gmp_float.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/gmp_float.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/gmp_float.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -6,12 +6,12 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../floats.html" title="Floating Point Numbers">
-<link rel="prev" href="../floats.html" title="Floating Point Numbers">
+<link rel="prev" href="cpp_dec_float.html" title="cpp_dec_float">
<link rel="next" href="mpfr_float.html" title="mpfr_float">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="../floats.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="mpfr_float.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="cpp_dec_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="mpfr_float.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_floats_gmp_float">
<div class="titlepage"><div><div><h4 class="title">
@@ -177,7 +177,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../floats.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="mpfr_float.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="cpp_dec_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="mpfr_float.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/mpfr_float.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/mpfr_float.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/mpfr_float.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -7,11 +7,11 @@
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../floats.html" title="Floating Point Numbers">
<link rel="prev" href="gmp_float.html" title="gmp_float">
-<link rel="next" href="cpp_dec_float.html" title="cpp_dec_float">
+<link rel="next" href="fp_eg.html" title="Examples">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="gmp_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="cpp_dec_float.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="gmp_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_floats_mpfr_float">
<div class="titlepage"><div><div><h4 class="title">
@@ -166,7 +166,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="gmp_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="cpp_dec_float.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="gmp_float.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../floats.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="fp_eg.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -7,19 +7,19 @@
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../tut.html" title="Tutorial">
<link rel="prev" href="floats/fp_eg/poly_eg.html" title="Polynomial Evaluation">
-<link rel="next" href="rational/gmp_rational.html" title="gmp_rational">
+<link rel="next" href="rational/cpp_rational.html" title="cpp_rational">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="floats/fp_eg/poly_eg.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="rational/gmp_rational.html"><img src="../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="floats/fp_eg/poly_eg.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="rational/cpp_rational.html"><img src="../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_rational">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_multiprecision.tut.rational"></a><a class="link" href="rational.html" title="Rational Number Types">Rational Number Types</a>
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section">gmp_rational</span></dt>
<dt><span class="section">cpp_rational</span></dt>
+<dt><span class="section">gmp_rational</span></dt>
<dt><span class="section">tommath_rational</span></dt>
<dt><span class="section">Use With Boost.Rational</span></dt>
<dt><span class="section">rational_adapter</span></dt>
@@ -72,12 +72,12 @@
<tr>
<td>
<p>
- <code class="computeroutput"><span class="identifier">gmp_rational</span></code>
+ <code class="computeroutput"><span class="identifier">cpp_rational</span></code>
</p>
</td>
<td>
<p>
- boost/multiprecision/gmp.hpp
+ boost/multiprecision/cpp_int.hpp
</p>
</td>
<td>
@@ -87,30 +87,29 @@
</td>
<td>
<p>
- GMP
+ None
</p>
</td>
<td>
<p>
- Very fast and efficient back-end.
+ An all C++ Boost-licensed implementation.
</p>
</td>
<td>
<p>
- Dependency on GNU licensed GMP
- library.
+ Slower than GMP.
</p>
</td>
</tr>
<tr>
<td>
<p>
- <code class="computeroutput"><span class="identifier">cpp_rational</span></code>
+ <code class="computeroutput"><span class="identifier">gmp_rational</span></code>
</p>
</td>
<td>
<p>
- boost/multiprecision/cpp_int.hpp
+ boost/multiprecision/gmp.hpp
</p>
</td>
<td>
@@ -120,17 +119,18 @@
</td>
<td>
<p>
- None
+ GMP
</p>
</td>
<td>
<p>
- An all C++ Boost-licensed implementation.
+ Very fast and efficient back-end.
</p>
</td>
<td>
<p>
- Slower than GMP.
+ Dependency on GNU licensed GMP
+ library.
</p>
</td>
</tr>
@@ -246,7 +246,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="floats/fp_eg/poly_eg.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="rational/gmp_rational.html"><img src="../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="floats/fp_eg/poly_eg.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.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="rational/cpp_rational.html"><img src="../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/cpp_rational.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/cpp_rational.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/cpp_rational.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -6,12 +6,12 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../rational.html" title="Rational Number Types">
-<link rel="prev" href="gmp_rational.html" title="gmp_rational">
-<link rel="next" href="tommath_rational.html" title="tommath_rational">
+<link rel="prev" href="../rational.html" title="Rational Number Types">
+<link rel="next" href="gmp_rational.html" title="gmp_rational">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="gmp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="tommath_rational.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="../rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="gmp_rational.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_rational_cpp_rational">
<div class="titlepage"><div><div><h4 class="title">
@@ -107,7 +107,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="gmp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="tommath_rational.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="../rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="gmp_rational.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/gmp_rational.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/gmp_rational.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/gmp_rational.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -6,12 +6,12 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../rational.html" title="Rational Number Types">
-<link rel="prev" href="../rational.html" title="Rational Number Types">
-<link rel="next" href="cpp_rational.html" title="cpp_rational">
+<link rel="prev" href="cpp_rational.html" title="cpp_rational">
+<link rel="next" href="tommath_rational.html" title="tommath_rational">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="../rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="cpp_rational.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="cpp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="tommath_rational.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_rational_gmp_rational">
<div class="titlepage"><div><div><h4 class="title">
@@ -138,7 +138,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="cpp_rational.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="cpp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="tommath_rational.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/tommath_rational.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/tommath_rational.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/tommath_rational.html 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -6,12 +6,12 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../rational.html" title="Rational Number Types">
-<link rel="prev" href="cpp_rational.html" title="cpp_rational">
+<link rel="prev" href="gmp_rational.html" title="gmp_rational">
<link rel="next" href="br.html" title="Use With Boost.Rational">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
-<a accesskey="p" href="cpp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="br.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="gmp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="br.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section boost_multiprecision_tut_rational_tommath_rational">
<div class="titlepage"><div><div><h4 class="title">
@@ -113,7 +113,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="cpp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="br.html"><img src="../../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="gmp_rational.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../rational.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="br.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
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-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -46,9 +46,9 @@
</dl></dd>
<dt><span class="section">Floating Point Numbers</span></dt>
<dd><dl>
+<dt><span class="section">cpp_dec_float</span></dt>
<dt><span class="section">gmp_float</span></dt>
<dt><span class="section">mpfr_float</span></dt>
-<dt><span class="section">cpp_dec_float</span></dt>
<dt><span class="section">Examples</span></dt>
<dd><dl>
<dt><span class="section"><a href="boost_multiprecision/tut/floats/fp_eg/aos.html">Area of
@@ -65,8 +65,8 @@
</dl></dd>
<dt><span class="section">Rational Number Types</span></dt>
<dd><dl>
-<dt><span class="section">gmp_rational</span></dt>
<dt><span class="section">cpp_rational</span></dt>
+<dt><span class="section">gmp_rational</span></dt>
<dt><span class="section">tommath_rational</span></dt>
<dt><span class="section">Use With Boost.Rational</span></dt>
<dt><span class="section">rational_adapter</span></dt>
@@ -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: September 06, 2012 at 09:51:26 GMT</small></p></td>
+<td align="left"><p><small>Last revised: September 07, 2012 at 08:25:28 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-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -47,6 +47,16 @@
</imageobject>
</inlinemediaobject>''']
+[def __cpp_int [link boost_multiprecision.tut.ints.cpp_int cpp_int]]
+[def __gmp_int [link boost_multiprecision.tut.ints.gmp_int gmp_int]]
+[def __tom_int [link boost_multiprecision.tut.ints.tom_int tom_int]]
+[def __gmp_float [link boost_multiprecision.tut.floats.gmp_float gmp_float]]
+[def __mpfr_float_backend [link boost_multiprecision.tut.floats.mpfr_float mpfr_float]]
+[def __cpp_dec_float [link boost_multiprecision.tut.floats.cpp_dec_float cpp_dec_float]]
+[def __gmp_rational [link boost_multiprecision.tut.rational.gmp_rational gmp_rational]]
+[def __cpp_rational [link boost_multiprecision.tut.rational.cpp_rational cpp_rational]]
+[def __tommath_rational [link boost_multiprecision.tut.rational.tommath_rational tommath_rational]]
+
[section:intro Introduction]
The Multiprecision Library provides ['User-defined] integer, rational and floating-point C++ types which
@@ -504,11 +514,73 @@
[table
[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
+[[`cpp_dec_float<N>`][boost/multiprecision/cpp_dec_float.hpp][10][None][Header only, all C++ implementation. Boost licence.][Approximately 2x slower than the [mpfr] or [gmp] libraries.]]
[[`mpf_float<N>`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licensed [gmp] library.]]
[[`mpfr_float<N>`][boost/multiprecision/mpfr.hpp][2][[gmp] and [mpfr]][Very fast and efficient back-end, with its own standard library implementation.][Dependency on GNU licensed [gmp] and [mpfr] libraries.]]
-[[`cpp_dec_float<N>`][boost/multiprecision/cpp_dec_float.hpp][10][None][Header only, all C++ implementation. Boost licence.][Approximately 2x slower than the [mpfr] or [gmp] libraries.]]
]
+[section:cpp_dec_float cpp_dec_float]
+
+`#include <boost/multiprecision/cpp_dec_float.hpp>`
+
+ namespace boost{ namespace multiprecision{
+
+ template <unsigned Digits10, class ExponentType = boost::int32_t, class Allocator = void>
+ class cpp_dec_float;
+
+ typedef number<cpp_dec_float<50> > cpp_dec_float_50;
+ typedef number<cpp_dec_float<100> > cpp_dec_float_100;
+
+ }} // namespaces
+
+The `cpp_dec_float` back-end is used in conjunction with `number`: It acts as an entirely C++ (header only and dependency free)
+real-number type that is a drop-in replacement for the native C++ floating-point types, but with
+much greater precision.
+
+Type `cpp_dec_float` can be used at fixed precision by specifying a non-zero `Digits10` template parameter.
+The typedefs `cpp_dec_float_50` and `cpp_dec_float_100` provide arithmetic types at 50 and 100 decimal digits precision
+respectively. Optionally, you can specify an integer type to use for the exponent, this defaults to a 32-bit integer type
+which is more than large enough for the vast majority of use cases, but larger types such as `long long` can also be specified
+if you need a truely huge exponent range.
+
+Normally `cpp_dec_float` allocates no memory: all of the space required for it's digits are allocated
+directly within the class. As a result care should be taken not to use the class with too high a digit count
+as stack space requirements can grow out of control. If that represents a problem then providing an allocator
+as the final template parameter causes `cpp_dec_float` to dynamically allocate the memory it needs: this
+significantly reduces the size of `cpp_dec_float` and increases the viable upper limit on the number of digits
+at the expense of performance. However, please bare in mind that arithmetic operations rapidly become ['very] expensive
+as the digit count grows: the current implementation really isn't optimized or designed for large digit counts.
+
+There is full standard library and `numeric_limits` support available for this type.
+
+Things you should know when using this type:
+
+* Default constructed `cpp_dec_float`s have a value of zero.
+* The radix of this type is 10. As a result it can behave subtly differently from base-2 types.
+* It is not possible to round-trip this type to and from a string and get back to exactly the same value
+(this is a result of the type having some hidden internal guard digits).
+* The type has a number of internal guard digits over and above those specified in the template argument.
+Normally these should not be visible to the user.
+* The type supports both infinities and NaN's. An infinity is generated whenever the result would overflow,
+and a NaN is generated for any mathematically undefined operation.
+* There is a `std::numeric_limits` specialisation for this type.
+* Any `number` instantiated on this type, is convertible to any other `number` instantiated on this type -
+for example you can convert from `number<cpp_dec_float<50> >` to `number<cpp_dec_float<SomeOtherValue> >`.
+Narrowing conversions are truncating and `explicit`.
+* Conversion from a string results in a `std::runtime_error` being thrown if the string can not be interpreted
+as a valid floating point number.
+* The actual precision of a `cpp_dec_float` is always slightly higher than the number of digits specified in
+the template parameter, actually how much higher is an implementation detail but is always at least 8 decimal
+digits.
+* Operations involving `cpp_dec_float` are always truncating. However, note that since their are guard digits
+in effect, in practice this has no real impact on accuracy for most use cases.
+
+[h5 cpp_dec_float example:]
+
+[cpp_dec_float_eg]
+
+[endsect]
+
[section:gmp_float gmp_float]
`#include <boost/multiprecision/gmp.hpp>`
@@ -627,53 +699,6 @@
[endsect]
-[section:cpp_dec_float cpp_dec_float]
-
-`#include <boost/multiprecision/cpp_dec_float.hpp>`
-
- namespace boost{ namespace multiprecision{
-
- template <unsigned Digits10>
- class cpp_dec_float;
-
- typedef number<cpp_dec_float<50> > cpp_dec_float_50;
- typedef number<cpp_dec_float<100> > cpp_dec_float_100;
-
- }} // namespaces
-
-The `cpp_dec_float` back-end is used in conjunction with `number`: It acts as an entirely C++ (header only and dependency free)
-real-number type that is a drop-in replacement for the native C++ floating-point types, but with
-much greater precision.
-
-Type `cpp_dec_float` can be used at fixed precision by specifying a non-zero `Digits10` template parameter.
-The typedefs `cpp_dec_float_50` and `cpp_dec_float_100` provide arithmetic types at 50 and 100 decimal digits precision
-respectively.
-
-There is full standard library and `numeric_limits` support available for this type.
-
-Things you should know when using this type:
-
-* Default constructed `cpp_dec_float`s have a value of zero.
-* The radix of this type is 10. As a result it can behave subtly differently from base-2 types.
-* It is not possible to round-trip this type to and from a string and get back to exactly the same value
-(this is a result of the type having some hidden internal guard digits).
-* The type has a number of internal guard digits over and above those specified in the template argument.
-Normally these should not be visible to the user.
-* The type supports both infinities and NaN's. An infinity is generated whenever the result would overflow,
-and a NaN is generated for any mathematically undefined operation.
-* There is a `std::numeric_limits` specialisation for this type.
-* Any `number` instantiated on this type, is convertible to any other `number` instantiated on this type -
-for example you can convert from `number<cpp_dec_float<50> >` to `number<cpp_dec_float<SomeOtherValue> >`.
-Narrowing conversions are truncating.
-* Conversion from a string results in a `std::runtime_error` being thrown if the string can not be interpreted
-as a valid floating point number.
-
-[h5 cpp_dec_float example:]
-
-[cpp_dec_float_eg]
-
-[endsect]
-
[section:fp_eg Examples]
[import ../example/floating_point_examples.cpp]
@@ -723,98 +748,98 @@
[table
[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
-[[`gmp_rational`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licensed [gmp] library.]]
[[`cpp_rational`][boost/multiprecision/cpp_int.hpp][2][None][An all C++ Boost-licensed implementation.][Slower than [gmp].]]
+[[`gmp_rational`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licensed [gmp] library.]]
[[`tommath_rational`][boost/multiprecision/tommath.hpp][2][[tommath]][All C/C++ implementation that's Boost Software Licence compatible.][Slower than [gmp].]]
[[`rational_adapter`][boost/multiprecision/rational_adapter.hpp][N/A][none][All C++ adapter that allows any integer back-end type to be used as a rational type.][Requires an underlying integer back-end type.]]
[[`boost::rational`][boost/rational.hpp][N/A][None][A C++ rational number type that can used with any `number` integer type.][The expression templates used by `number` end up being "hidden" inside `boost::rational`: performance may well suffer as a result.]]
]
-[section:gmp_rational gmp_rational]
+[section:cpp_rational cpp_rational]
-`#include <boost/multiprecision/gmp.hpp>`
+`#include <boost/multiprecision/cpp_int.hpp>`
namespace boost{ namespace multiprecision{
- class gmp_rational;
+ typedef rational_adapter<cpp_int_backend<> > cpp_rational_backend;
- typedef number<gmp_rational > mpq_rational;
+ typedef number<cpp_rational_backend> cpp_rational;
}} // namespaces
-The `gmp_rational` back-end is used via the typedef `boost::multiprecision::mpq_rational`. It acts as a thin wrapper around the [gmp] `mpq_t`
-to provide a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision.
-
-As well as the usual conversions from arithmetic and string types, instances of `number<gmp_rational>` are copy constructible
-and assignable from:
+The `cpp_rational_backend` type is used via the typedef `boost::multiprecision::cpp_rational`. It provides
+a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision.
-* The [gmp] native types: `mpz_t`, `mpq_t`.
-* `number<gmp_int>`.
+As well as the usual conversions from arithmetic and string types, instances of `cpp_rational` are copy constructible
+and assignable from type `cpp_int`.
-There is also a two-argument constructor that accepts a numerator and denominator (both of type `number<gmp_int>`).
+There is also a two argument constructor that accepts a numerator and denominator: both of type `cpp_int`.
There are also non-member functions:
- mpz_int numerator(const mpq_rational&);
- mpz_int denominator(const mpq_rational&);
+ cpp_int numerator(const cpp_rational&);
+ cpp_int denominator(const cpp_rational&);
which return the numerator and denominator of the number.
-It's also possible to access the underlying `mpq_t` via the `data()` member function of `mpq_rational`.
-
Things you should know when using this type:
-* Default constructed `mpq_rational`s have the value zero (this is the [gmp] default behavior).
-* Division by zero results in a `std::runtime_error` being thrown.
+* Default constructed `cpp_rational`s have the value zero.
+* Division by zero results in a `std::rumtime_error` being thrown.
* Conversion from a string results in a `std::runtime_error` being thrown if the string can not be
interpreted as a valid rational number.
-* No changes are made to the [gmp] library's global settings, so this type can coexist with existing
-[gmp] code.
-* The code can equally be used with [mpir] as the underlying library - indeed that is the preferred option on Win32.
[h5 Example:]
-[mpq_eg]
+[cpp_rational_eg]
[endsect]
-[section:cpp_rational cpp_rational]
+[section:gmp_rational gmp_rational]
-`#include <boost/multiprecision/cpp_int.hpp>`
+`#include <boost/multiprecision/gmp.hpp>`
namespace boost{ namespace multiprecision{
- typedef rational_adapter<cpp_int_backend<> > cpp_rational_backend;
+ class gmp_rational;
- typedef number<cpp_rational_backend> cpp_rational;
+ typedef number<gmp_rational > mpq_rational;
}} // namespaces
-The `cpp_rational_backend` type is used via the typedef `boost::multiprecision::cpp_rational`. It provides
-a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision.
+The `gmp_rational` back-end is used via the typedef `boost::multiprecision::mpq_rational`. It acts as a thin wrapper around the [gmp] `mpq_t`
+to provide a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision.
-As well as the usual conversions from arithmetic and string types, instances of `cpp_rational` are copy constructible
-and assignable from type `cpp_int`.
+As well as the usual conversions from arithmetic and string types, instances of `number<gmp_rational>` are copy constructible
+and assignable from:
-There is also a two argument constructor that accepts a numerator and denominator: both of type `cpp_int`.
+* The [gmp] native types: `mpz_t`, `mpq_t`.
+* `number<gmp_int>`.
+
+There is also a two-argument constructor that accepts a numerator and denominator (both of type `number<gmp_int>`).
There are also non-member functions:
- cpp_int numerator(const cpp_rational&);
- cpp_int denominator(const cpp_rational&);
+ mpz_int numerator(const mpq_rational&);
+ mpz_int denominator(const mpq_rational&);
which return the numerator and denominator of the number.
+It's also possible to access the underlying `mpq_t` via the `data()` member function of `mpq_rational`.
+
Things you should know when using this type:
-* Default constructed `cpp_rational`s have the value zero.
-* Division by zero results in a `std::rumtime_error` being thrown.
+* Default constructed `mpq_rational`s have the value zero (this is the [gmp] default behavior).
+* Division by zero results in a `std::runtime_error` being thrown.
* Conversion from a string results in a `std::runtime_error` being thrown if the string can not be
interpreted as a valid rational number.
+* No changes are made to the [gmp] library's global settings, so this type can coexist with existing
+[gmp] code.
+* The code can equally be used with [mpir] as the underlying library - indeed that is the preferred option on Win32.
[h5 Example:]
-[cpp_rational_eg]
+[mpq_eg]
[endsect]
@@ -1494,7 +1519,7 @@
``['unmentionable-expression-template-type]`` fmod (const ``['number-or-expression-template-type]``&, const ``['number-or-expression-template-type]``&);
``['unmentionable-expression-template-type]`` atan2 (const ``['number-or-expression-template-type]``&, const ``['number-or-expression-template-type]``&);
-These functions all behave exactly as their standard library counterparts do: their argument is either an instance of `number` or
+These functions all behave exactly as their standard library C++11 counterparts do: their argument is either an instance of `number` or
an expression template derived from it; If the argument is of type `number<Backend, et_off>` then that is also the return type,
otherwise the return type is an expression template.
@@ -1506,6 +1531,35 @@
Also note that with the exception of `abs` that these functions can only be used with floating-point Backend types (if any other types
such as fixed precision or complex types are added to the library later, then these functions may be extended to support those number types).
+The precision of these functions is generally deterimined by the backend implementation. For example the precision
+of these functions when used with __mpfr_float_backend is determined entirely by [mpfr]. When these functions use our own
+implementations, the accuracy of the transcendal functions is generally a few epsilon. Note however, that the trigonmetrical
+functions incur the usual accuracy loss when reducing arguments by large multiples of [pi]. Also note that both __mpf_float
+and __cpp_dec_float have a number of guard digits beyond their stated precision, so the error rates listed for these
+are in some sense artificially low.
+
+The following table shows the error rates we observe for these functions with various backend types, functions not listed
+here are exact (tested on Win32 with VC++10, MPFR-3.0.0, MPIR-2.1.1):
+
+[table
+[[Function][mpfr_float_50][mpf_float_50][cpp_dec_float_50]]
+[[sqrt][1eps][0eps][0eps]]
+[[exp][1eps][0eps][0eps]]
+[[log][1eps][0eps][0eps]]
+[[log10][1eps][0eps][0eps]]
+[[cos][700eps][0eps][0eps]]
+[[sin][1eps][0eps][0eps]]
+[[tan][][][]]
+[[acos][][][]]
+[[asin][][][]]
+[[atan][][][]]
+[[cosh][][][]]
+[[sinh][][][]]
+[[tanh][][][]]
+[[pow][][][]]
+[[fmod][][][]]
+[[atan2][][][]]
+]
[h4 Traits Class Support]
template <class T>
@@ -2602,6 +2656,8 @@
* Many functions made made `constexp`?
* Differentiate between explicit and implicit conversions in the number constructor.
* Removed "mp_" prefix from types.
+* Allowed mixed precision arithmetic.
+* Changed ExpressionTemplates parameter to class `number` to use enumerated values rather than true/false.
[h4 Pre-review history]
@@ -2632,18 +2688,18 @@
* Can ring types (exact floating point types) be supported? The answer should be yes, but someone needs to write it.
* Make the exponent type for cpp_dec_float a templare parameter, maybe include support for big-integer exponents.
-Open question - what should be the default - int32_t or int64_t?
+Open question - what should be the default - int32_t or int64_t? (done 2012/09/06)
* Document the size requirements of fixed precision ints.
* Document std lib function accuracy.
* Make fixed precision orthogonal to Allocator type in cpp_int. Possible solution - add an additional MaxBits
template argument that defaults to 0 (meaning keep going till no more space/memory).
* Add support for fused multiply add (and subtract). GMP mpz_t could use this.
* Be a bit clearer on the effects of sign-magnitude representation of cpp_int - min == -max etc.
-* Document cpp_dec_float precision, rounding, and exponent size.
-* Can we be clearer in the docs that mixed arithmetic doesn't work?
-* Document round functions behaviour better (they behave as in C99).
+* Document cpp_dec_float precision, rounding, and exponent size (done 2012/09/06).
+* Can we be clearer in the docs that mixed arithmetic doesn't work (no longer applicable as of 2012/09/06)?
+* Document round functions behaviour better (they behave as in C++11) (added note 2012/09/06).
* Should there be a choice of rounding mode (probably MPFR specific)?
-* Document limits on size of cpp_dec_float.
+* Document limits on size of cpp_dec_float (done 2012/09/06).
[endsect]
Modified: sandbox/big_number/libs/multiprecision/test/math/log1p_expm1_test.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/log1p_expm1_test.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/log1p_expm1_test.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -140,7 +140,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/powm1_sqrtp1m1_test.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/powm1_sqrtp1m1_test.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/powm1_sqrtp1m1_test.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -132,7 +132,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_powm1_sqrtp1m1(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_powm1_sqrtp1m1(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_powm1_sqrtp1m1(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_powm1_sqrtp1m1(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/table_type.hpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/table_type.hpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/table_type.hpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -27,7 +27,7 @@
return os << static_cast<const char*>(what);
}
-template <class Backend, expression_template_option ExpressionTemplates>
+template <class Backend, boost::multiprecision::expression_template_option ExpressionTemplates>
struct table_type<boost::multiprecision::number<Backend, ExpressionTemplates> >
{
typedef string_table_entry type;
Modified: sandbox/big_number/libs/multiprecision/test/math/test_bessel_i.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_bessel_i.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_bessel_i.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -101,7 +101,7 @@
test_bessel(number<cpp_dec_float<8> >(), "number<cpp_dec_float<8> >");
test_bessel(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_bessel(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_bessel(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_bessel(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_bessel_j.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_bessel_j.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_bessel_j.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -142,7 +142,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_bessel(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_bessel(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_bessel(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_bessel(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_bessel_k.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_bessel_k.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_bessel_k.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -115,7 +115,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_bessel(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_bessel(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_bessel(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_bessel(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_bessel_y.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_bessel_y.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_bessel_y.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -141,7 +141,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_bessel(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_bessel(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_bessel(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_bessel(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_beta.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_beta.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_beta.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -127,7 +127,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_binomial_coeff.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_binomial_coeff.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_binomial_coeff.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -106,7 +106,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_binomial(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_binomial(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_binomial(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_binomial(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_carlson.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_carlson.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_carlson.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -98,7 +98,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_spots(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_spots(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_spots(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_spots(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_cbrt.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_cbrt.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_cbrt.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -87,7 +87,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_cbrt(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_cbrt(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_cbrt(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_cbrt(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_digamma.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_digamma.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_digamma.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -101,7 +101,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_digamma(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_digamma(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_digamma(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_digamma(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ellint_1.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ellint_1.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ellint_1.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -94,7 +94,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_spots(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_spots(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_spots(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_spots(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ellint_2.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ellint_2.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ellint_2.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -87,7 +87,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_spots(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_spots(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_spots(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_spots(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ellint_3.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ellint_3.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ellint_3.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -108,7 +108,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_spots(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_spots(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_spots(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_spots(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_erf.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_erf.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_erf.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -108,7 +108,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_erf(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_erf(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_erf(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_erf(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_expint.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_expint.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_expint.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -108,7 +108,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_expint(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_expint(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_expint(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_expint(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_gamma.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_gamma.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_gamma.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -122,7 +122,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_gamma(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_gamma(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_gamma(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_gamma(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_hermite.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_hermite.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_hermite.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -87,7 +87,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_hermite(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_hermite(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_hermite(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_hermite(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ibeta.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ibeta.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ibeta.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -118,7 +118,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ibeta_2.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ibeta_2.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ibeta_2.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -118,7 +118,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ibeta_3.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ibeta_3.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ibeta_3.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -104,7 +104,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ibeta_4.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ibeta_4.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ibeta_4.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -111,7 +111,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_1.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_1.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_1.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -97,7 +97,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_ab_4.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_ab_4.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_ibeta_inv_ab_4.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -90,7 +90,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_beta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_beta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_beta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_beta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_igamma.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_igamma.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_igamma.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -94,7 +94,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_gamma(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_gamma(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_gamma(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_gamma(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_igamma_inv.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_igamma_inv.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_igamma_inv.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -109,7 +109,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_gamma(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_gamma(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_gamma(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_gamma(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_igamma_inva.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_igamma_inva.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_igamma_inva.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -88,7 +88,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_gamma(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_gamma(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_gamma(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_gamma(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_laguerre.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_laguerre.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_laguerre.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -87,7 +87,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_laguerre(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_laguerre(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_laguerre(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_laguerre(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_legendre.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_legendre.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_legendre.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -87,7 +87,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_legendre_p(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_legendre_p(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_legendre_p(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_legendre_p(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_tgamma_ratio.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_tgamma_ratio.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_tgamma_ratio.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -101,7 +101,7 @@
#ifdef TEST_CPP_DEC_FLOAT
test_tgamma_ratio(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_tgamma_ratio(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_tgamma_ratio(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_tgamma_ratio(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/math/test_zeta.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/math/test_zeta.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/math/test_zeta.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -96,7 +96,7 @@
test_zeta(number<cpp_dec_float<9> >(), "number<cpp_dec_float<9> >");
test_zeta(number<cpp_dec_float<18> >(), "number<cpp_dec_float<18> >");
test_zeta(number<cpp_dec_float<30> >(), "number<cpp_dec_float<30> >");
- test_zeta(number<cpp_dec_float<35> >(), "number<cpp_dec_float<35> >");
+ test_zeta(number<cpp_dec_float<35, long long, std::allocator<void> > >(), "number<cpp_dec_float<35, long long, std::allocator<void> > >");
#endif
return 0;
}
Modified: sandbox/big_number/libs/multiprecision/test/test_acos.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_acos.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_acos.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -107,10 +107,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
#endif
return boost::report_errors();
}
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-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -1654,7 +1654,8 @@
#endif
#ifdef TEST_CPP_DEC_FLOAT
test<boost::multiprecision::cpp_dec_float_50>();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>, boost::multiprecision::et_off> >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100, long long>, boost::multiprecision::et_off> >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100, long long, std::allocator<void> >, boost::multiprecision::et_on> >();
#endif
#ifdef TEST_MPFR
test<boost::multiprecision::mpfr_float>();
Modified: sandbox/big_number/libs/multiprecision/test/test_asin.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_asin.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_asin.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -103,10 +103,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_atan.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_atan.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_atan.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -249,10 +249,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_cos.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_cos.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_cos.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -47,6 +47,7 @@
template <class T>
void test()
{
+ std::cout << "Testing type " << typeid(T).name() << std::endl;
static const boost::array<const char*, 101u> data =
{{
"-2.37609908807915949996042688873953402912174184373388399043229539427530802169622688886435380890546981798452174137747437590e-1",
@@ -303,10 +304,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
#endif
return boost::report_errors();
}
Modified: sandbox/big_number/libs/multiprecision/test/test_cosh.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_cosh.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_cosh.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -145,10 +145,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
#endif
return boost::report_errors();
}
Modified: sandbox/big_number/libs/multiprecision/test/test_exp.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_exp.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_exp.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -47,6 +47,7 @@
template <class T>
void test()
{
+ std::cout << "Testing type " << typeid(T).name() << std::endl;
static const boost::array<const char*, 51u> data =
{{
"1.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
@@ -185,10 +186,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_log.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_log.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_log.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -47,6 +47,7 @@
template <class T>
void test()
{
+ std::cout << "Testing type " << typeid(T).name() << std::endl;
static const boost::array<const char*, 101> data =
{{
"-2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806",
@@ -213,10 +214,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_pow.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_pow.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_pow.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -588,10 +588,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_round.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_round.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_round.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -394,10 +394,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
#endif
#ifdef TEST_BACKEND
test<boost::multiprecision::number<boost::multiprecision::concepts::number_backend_float_architype> >();
Modified: sandbox/big_number/libs/multiprecision/test/test_sin.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_sin.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_sin.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -47,6 +47,7 @@
template <class T>
void test()
{
+ std::cout << "Testing type: " << typeid(T).name() << std::endl;
static const boost::array<const char*, 101u> data =
{{
"-9.71360659712083391437631022096936715962104815777147739346439739644168480837178969413799829610404829247283169084501281105e-1",
@@ -297,10 +298,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_sinh.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_sinh.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_sinh.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -221,10 +221,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_sqrt.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_sqrt.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_sqrt.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -191,10 +191,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
// Check low multiprecision digit counts.
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<9> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<18> > >();
Modified: sandbox/big_number/libs/multiprecision/test/test_tanh.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_tanh.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_tanh.cpp 2012-09-07 04:31:49 EDT (Fri, 07 Sep 2012)
@@ -140,10 +140,10 @@
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<64> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<63> > >();
test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<62> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59> > >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<61, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<60, long long> > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<59, long long, std::allocator<void> > > >();
+ test<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<58, long long, std::allocator<void> > > >();
#endif
return boost::report_errors();
}
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