From e2ef393c232c4c3deaf81c0b7279b5040c195566 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 8 Aug 2012 18:14:50 +0000 Subject: [PATCH] Big search and replace rename, removing mp_ prefix. [SVN r79932] --- doc/multiprecision.qbk | 556 ++++---- example/cpp_int_snips.cpp | 2 +- example/floating_point_examples.cpp | 4 +- example/integer_examples.cpp | 2 +- .../concepts/mp_number_archetypes.hpp | 8 +- .../boost/multiprecision/cpp_dec_float.hpp | 78 +- include/boost/multiprecision/cpp_int.hpp | 170 +-- .../depricated/arithmetic_backend.hpp | 6 +- .../multiprecision/depricated/fixed_int.hpp | 26 +- .../multiprecision/detail/big_lanczos.hpp | 4 +- .../detail/cpp_int_trivial_ops.hpp | 12 +- .../multiprecision/detail/default_ops.hpp | 376 ++--- .../detail/functions/constants.hpp | 6 +- .../multiprecision/detail/functions/pow.hpp | 22 +- .../multiprecision/detail/functions/trig.hpp | 24 +- .../detail/generic_interconvert.hpp | 18 +- .../multiprecision/detail/integer_ops.hpp | 64 +- .../multiprecision/detail/mp_number_base.hpp | 1262 ----------------- .../detail/mp_number_compare.hpp | 482 ------- .../boost/multiprecision/detail/no_et_ops.hpp | 334 ++--- .../multiprecision/detail/number_base.hpp | 1262 +++++++++++++++++ .../multiprecision/detail/number_compare.hpp | 482 +++++++ include/boost/multiprecision/gmp.hpp | 186 +-- include/boost/multiprecision/miller_rabin.hpp | 16 +- include/boost/multiprecision/mpfr.hpp | 126 +- .../{mp_number.hpp => number.hpp} | 198 +-- include/boost/multiprecision/random.hpp | 34 +- .../boost/multiprecision/rational_adapter.hpp | 22 +- include/boost/multiprecision/tommath.hpp | 54 +- performance/arithmetic_backend.hpp | 6 +- performance/delaunay_test.cpp | 12 +- performance/linpack-benchmark.cpp | 8 +- performance/miller_rabin_performance.cpp | 16 +- performance/performance_test.cpp | 14 +- performance/sf_performance.cpp | 24 +- ...ept_check.cpp => number_concept_check.cpp} | 18 +- test/concepts/sf_concept_check_basic.cpp | 10 +- test/concepts/sf_concept_check_bessel.cpp | 10 +- test/concepts/sf_concept_check_elliptic.cpp | 10 +- test/concepts/sf_concept_check_gamma.cpp | 10 +- test/concepts/sf_concept_check_poly.cpp | 10 +- test/include_test/cpp_int_include_test.cpp | 10 +- test/math/log1p_expm1_test.cpp | 18 +- test/math/powm1_sqrtp1m1_test.cpp | 18 +- test/math/test_bessel_i.cpp | 20 +- test/math/test_bessel_j.cpp | 18 +- test/math/test_bessel_k.cpp | 18 +- test/math/test_bessel_y.cpp | 18 +- test/math/test_beta.cpp | 18 +- test/math/test_binomial_coeff.cpp | 18 +- test/math/test_carlson.cpp | 18 +- test/math/test_cbrt.cpp | 18 +- test/math/test_digamma.cpp | 18 +- test/math/test_ellint_1.cpp | 18 +- test/math/test_ellint_2.cpp | 18 +- test/math/test_ellint_3.cpp | 18 +- test/math/test_erf.cpp | 18 +- test/math/test_expint.cpp | 18 +- test/math/test_gamma.cpp | 18 +- test/math/test_hermite.cpp | 18 +- test/math/test_ibeta.cpp | 18 +- test/math/test_ibeta_2.cpp | 18 +- test/math/test_ibeta_3.cpp | 18 +- test/math/test_ibeta_4.cpp | 18 +- test/math/test_ibeta_inv_1.cpp | 18 +- test/math/test_ibeta_inv_ab_4.cpp | 18 +- test/math/test_igamma.cpp | 18 +- test/math/test_igamma_inv.cpp | 18 +- test/math/test_igamma_inva.cpp | 18 +- test/math/test_laguerre.cpp | 18 +- test/math/test_legendre.cpp | 18 +- test/math/test_tgamma_ratio.cpp | 18 +- test/math/test_zeta.cpp | 20 +- test/test_acos.cpp | 18 +- test/test_arithmetic.cpp | 26 +- test/test_asin.cpp | 22 +- test/test_atan.cpp | 24 +- test/test_constants.cpp | 8 +- test/test_constexpr.cpp | 8 +- test/test_cos.cpp | 18 +- test/test_cosh.cpp | 18 +- test/test_cpp_int.cpp | 2 +- test/test_exp.cpp | 22 +- test/test_fixed_int.cpp | 2 +- test/test_float_io.cpp | 14 +- test/test_fpclassify.cpp | 2 +- test/test_generic_conv.cpp | 6 +- test/test_int_io.cpp | 6 +- test/test_log.cpp | 22 +- test/test_numeric_limits.cpp | 10 +- test/test_pow.cpp | 22 +- test/test_rational_io.cpp | 4 +- test/test_round.cpp | 18 +- test/test_sin.cpp | 22 +- test/test_sinh.cpp | 22 +- test/test_sqrt.cpp | 26 +- test/test_tanh.cpp | 18 +- test/ublas_interop/test1.hpp | 2 +- test/ublas_interop/test2.hpp | 2 +- test/ublas_interop/test3.hpp | 2 +- test/ublas_interop/test4.hpp | 2 +- test/ublas_interop/test5.hpp | 2 +- test/ublas_interop/test7.hpp | 2 +- 103 files changed, 3466 insertions(+), 3462 deletions(-) delete mode 100644 include/boost/multiprecision/detail/mp_number_base.hpp delete mode 100644 include/boost/multiprecision/detail/mp_number_compare.hpp create mode 100644 include/boost/multiprecision/detail/number_base.hpp create mode 100644 include/boost/multiprecision/detail/number_compare.hpp rename include/boost/multiprecision/{mp_number.hpp => number.hpp} (86%) rename test/concepts/{mp_number_concept_check.cpp => number_concept_check.cpp} (85%) diff --git a/doc/multiprecision.qbk b/doc/multiprecision.qbk index 71b6a134..46679178 100644 --- a/doc/multiprecision.qbk +++ b/doc/multiprecision.qbk @@ -59,7 +59,7 @@ expression-template-enabled for better performance than naive user-defined types The Multiprecision library comes in two distinct parts: -* An expression-template-enabled front-end `mp_number` +* An expression-template-enabled front-end `number` that handles all the operator overloading, expression evaluation optimization, and code reduction. * A selection of back-ends that implement the actual arithmetic operations, and need conform only to the reduced interface requirements of the front-end. @@ -76,7 +76,7 @@ integer type using [gmp] as the underlying implementation then you could use: boost::multiprecision::mpz_int myint; // Arbitrary precision integer type. -Alternatively, you can compose your own multiprecision type, by combining `mp_number` with one of the +Alternatively, you can compose your own multiprecision type, by combining `number` with one of the predefined back-end types. For example, suppose you wanted a 300 decimal digit floating-point type based on the [mpfr] library. In this case, there's no predefined typedef with that level of precision, so instead we compose our own: @@ -85,18 +85,18 @@ so instead we compose our own: namespace mp = boost::multiprecision; // Reduce the typing a bit later... - typedef mp::mp_number > my_float; + typedef mp::number > my_float; my_float a, b, c; // These variables have 300 decimal digits precision We can repeat the above example, but with the expression templates disabled (for faster compile times, but slower runtimes) -by passing a second template argument to `mp_number`: +by passing a second template argument to `number`: #include // Defines the Backend type that wraps MPFR namespace mp = boost::multiprecision; // Reduce the typing a bit later... - typedef mp::mp_number, false> my_float; + typedef mp::number, false> my_float; my_float a, b, c; // These variables have 300 decimal digits precision @@ -106,8 +106,8 @@ Note that mixing arithmetic operations using types of different precision is str namespace mp = boost::multiprecision; // Reduce the typing a bit later... - mp::mp_int128_t a(3), b(2); - mp::mp_int512_t c(50), d; + mp::int128_t a(3), b(2); + mp::int512_t c(50), d; d = c * a; // Compiler error @@ -115,19 +115,19 @@ However, conversions are allowed: d = a; // OK, widening conversion. d = a * b; // OK, can convert from an expression template too. - d = mp::mp_int512_t(a) * c; // OK, all the types in the expression are the same now. + d = mp::int512_t(a) * c; // OK, all the types in the expression are the same now. [h4 Expression Templates] TODO: compare to rvalue refs. -Class `mp_number` is expression-template-enabled: that means that rather than having a multiplication +Class `number` is expression-template-enabled: that means that rather than having a multiplication operator that looks like this: template - mp_number operator * (const mp_number& a, const mp_number& b) + number operator * (const number& a, const number& b) { - mp_number result(a); + number result(a); result *= b; return result; } @@ -135,7 +135,7 @@ operator that looks like this: Instead the operator looks more like this: template - ``['unmentionable-type]`` operator * (const mp_number& a, const mp_number& b); + ``['unmentionable-type]`` operator * (const number& a, const number& b); Where the "unmentionable" return type is an implementation detail that, rather than containing the result of the multiplication, contains instructions on how to compute the result. In effect it's just a pair @@ -151,7 +151,7 @@ lets suppose we're evaluating a polynomial via Horners method, something like th //.... y = (((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]; -If type `T` is an `mp_number`, then this expression is evaluated ['without creating a single temporary value]. In contrast, +If type `T` is an `number`, then this expression is evaluated ['without creating a single temporary value]. In contrast, if we were using the [mpfr_class] C++ wrapper for [mpfr] - then this expression would result in no less than 11 temporaries (this is true even though [mpfr_class] does use expression templates to reduce the number of temporaries somewhat). Had we used an even simpler wrapper around [mpfr] like [mpreal] things would have been even worse and no less that 24 temporaries @@ -164,7 +164,7 @@ rvalue references. The number of 11 temporaries was generated with Visual C++ 1 [footnote Marc Glisse suggested pre-review that this could be reduced still further by careful use of rvalue-references and move semantics in the operator overloads. This will be investigated further at a later date.]. -This library also extends expression template support to standard library functions like `abs` or `sin` with `mp_number` +This library also extends expression template support to standard library functions like `abs` or `sin` with `number` arguments. This means that an expression such as: y = abs(x); @@ -185,7 +185,7 @@ Given the comments above, you might be forgiven for thinking that expression-tem sadly though, all tricks like this have their downsides. For one thing, expression template libraries like this one, tend to be slower to compile than their simpler cousins, they're also harder to debug (should you actually want to step through our code!), and rely on compiler optimizations being turned -on to give really good performance. Also, since the return type from expressions involving `mp_number`s +on to give really good performance. Also, since the return type from expressions involving `number`s is an "unmentionable implementation detail", you have to be careful to cast the result of an expression to the actual number type when passing an expression to a template function. For example, given: @@ -224,7 +224,7 @@ we see the following typical results for polynomial execution: [table Evaluation of Order 6 Polynomial. [[Library][Relative Time][Relative number of memory allocations]] -[[mp_number][1.0 (0.00793s)][1.0 (2996 total)]] +[[number][1.0 (0.00793s)][1.0 (2996 total)]] [[[mpfr_class]][1.2 (0.00931s)][4.3 (12976 total)]] [[[mpreal]][1.9 (0.0148s)][9.3 (27947 total)]] ] @@ -241,7 +241,7 @@ magic by converting out-of-place operators to in-place ones, we necessarily take transformation is more efficient than creating the extra temporary variable, just not by as much as one would hope. -Finally, note that `mp_number` takes a second template argument, which, when set to `false` disables all +Finally, note that `number` takes a second template argument, which, when set to `false` disables all the expression template machinery. The result is much faster to compile, but slower at runtime. We'll conclude this section by providing some more performance comparisons between these three libraries, @@ -252,14 +252,14 @@ TODO: Update, compare to rvalue refs but no ET's as well. [table Evaluation of Boost.Math's Bessel function test data [[Library][Relative Time][Relative Number of Memory Allocations]] -[[mp_number][1.0 (6.21s)][1.0 (2685469)]] +[[number][1.0 (6.21s)][1.0 (2685469)]] [[[mpfr_class]][1.04 (6.45s)][1.47 (3946007)]] [[[mpreal]][1.53 (9.52s)][4.92 (13222940)]] ] [table Evaluation of Boost.Math's Non-Central T distribution test data [[Library][Relative Time][Relative Number of Memory Allocations]] -[[mp_number][1.0 (269s)][1.0 (139082551)]] +[[number][1.0 (269s)][1.0 (139082551)]] [[[mpfr_class]][1.04 (278s)][1.81 (252400791)]] [[[mpreal]][1.49 (401s)][3.22 (447009280)]] ] @@ -294,28 +294,28 @@ The following back-ends provide integer arithmetic: template > class cpp_int_backend; - typedef mp_number > cpp_int; // arbitrary precision integer + typedef number > cpp_int; // arbitrary precision integer typedef rational_adapter > cpp_rational_backend; - typedef mp_number cpp_rational; // arbitrary precision rational number + typedef number cpp_rational; // arbitrary precision rational number // Fixed precision unsigned types: - typedef mp_number, false> mp_uint128_t; - typedef mp_number, false> mp_uint256_t; - typedef mp_number, false> mp_uint512_t; - typedef mp_number, false> mp_uint1024_t; + typedef number, false> uint128_t; + typedef number, false> uint256_t; + typedef number, false> uint512_t; + typedef number, false> uint1024_t; // Fixed precision signed types: - typedef mp_number, false> mp_int128_t; - typedef mp_number, false> mp_int256_t; - typedef mp_number, false> mp_int512_t; - typedef mp_number, false> mp_int1024_t; + typedef number, false> int128_t; + typedef number, false> int256_t; + typedef number, false> int512_t; + typedef number, false> int1024_t; }} // namespaces The `cpp_int_backend` type is used via one of the typedefs `boost::multiprecision::cpp_int`, -`boost::multiprecision::mp_uint128_t`, `boost::multiprecision::mp_uint256_t`, -`boost::multiprecision::mp_uint512_t`, `boost::multiprecision::mp_int128_t`, `boost::multiprecision::mp_int256_t` -or `boost::multiprecision::mp_int512_t`. +`boost::multiprecision::uint128_t`, `boost::multiprecision::uint256_t`, +`boost::multiprecision::uint512_t`, `boost::multiprecision::int128_t`, `boost::multiprecision::int256_t` +or `boost::multiprecision::int512_t`. This back-end is the "Swiss Army Knife" of integer types as it can represent both fixed and [@http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic arbitrary precision] @@ -343,7 +343,7 @@ Things you should know when using this type: * Since the precision of `cpp_int_backend` is necessarily limited when the allocator parameter is void, care should be taken to avoid numeric overflow when using this type unless you actually want modulo-arithmetic behavior. -* The type uses a sign-magnitude representation internally, so type `mp_int128_t` has 128-bits of precision plus an extra sign bit. +* The type uses a sign-magnitude representation internally, so type `int128_t` has 128-bits of precision plus an extra sign bit. In this respect the behaviour of these types differs from built-in 2's complement types. In might be tempting to use a 127-bit type instead, and indeed this does work, but behaviour is still slightly different from a 2's complement built-in type as the min and max values are identical (apart from the sign), where as they differ by one for a true 2's complement type. @@ -356,9 +356,9 @@ difference to the performance of these types either way - so we may as well have the feature off. * Unsigned types support subtraction, and unary negation - the result is "as if" a 2's complement operation had been performed - in other words they behave pretty much as a built in integer type would in this situation. So for example if we were using - `mp_uint128_t` then both `mp_uint128_t(1)-4` and `-mp_uint128(3)` would result in the value `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD` - of type `mp_uint128_t`. -* This backend supports rvalue-references and is move-aware, making instantiations of `mp_number` on this backend move aware. + `uint128_t` then both `uint128_t(1)-4` and `-uint128(3)` would result in the value `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD` + of type `uint128_t`. +* This backend supports rvalue-references and is move-aware, making instantiations of `number` on this backend move aware. [h5 Example:] @@ -375,7 +375,7 @@ the feature off. class gmp_int; - typedef mp_number mpz_int; + typedef number mpz_int; }} // namespaces @@ -385,7 +385,7 @@ to provide an integer type that is a drop-in replacement for the native C++ inte As well as the usual conversions from arithmetic and string types, type `mpz_int` is copy constructible and assignable from: * The [gmp] native types: `mpf_t`, `mpz_t`, `mpq_t`. -* Instances of `mp_number` that are wrappers around those types: `mp_number >`, `mp_number`. +* Instances of `number` that are wrappers around those types: `number >`, `number`. It's also possible to access the underlying `mpz_t` via the `data()` member function of `gmp_int`. @@ -402,7 +402,7 @@ as a valid integer. * Division by zero results in a `std::runtime_error` being thrown. * Although this type is a wrapper around [gmp] it will work equally well with [mpir]. Indeed use of [mpir] is recommended on Win32. -* This backend supports rvalue-references and is move-aware, making instantiations of `mp_number` on this backend move aware. +* This backend supports rvalue-references and is move-aware, making instantiations of `number` on this backend move aware. [h5 Example:] @@ -418,7 +418,7 @@ is recommended on Win32. class tommath_int; - typedef mp_number tom_int; + typedef number tom_int; }} // namespaces @@ -481,15 +481,15 @@ The following back-ends provide floating point arithmetic: template class gmp_float; - typedef mp_number > mpf_float_50; - typedef mp_number > mpf_float_100; - typedef mp_number > mpf_float_500; - typedef mp_number > mpf_float_1000; - typedef mp_number > mpf_float; + typedef number > mpf_float_50; + typedef number > mpf_float_100; + typedef number > mpf_float_500; + typedef number > mpf_float_1000; + typedef number > mpf_float; }} // namespaces -The `gmp_float` back-end is used in conjunction with `mp_number` : it acts as a thin wrapper around the [gmp] `mpf_t` +The `gmp_float` back-end is used in conjunction with `number` : it acts as a thin wrapper around the [gmp] `mpf_t` to provide an real-number type that is a drop-in replacement for the native C++ floating-point types, but with much greater precision. @@ -497,15 +497,15 @@ Type `gmp_float` can be used at fixed precision by specifying a non-zero `Digits at variable precision by setting the template argument to zero. The typedefs mpf_float_50, mpf_float_100, mpf_float_500, mpf_float_1000 provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision respectively. The typedef mpf_float provides a variable precision type whose precision can be controlled via the -`mp_number`s member functions. +`number`s member functions. [note This type only provides standard library and `numeric_limits` support when the precision is fixed at compile time.] -As well as the usual conversions from arithmetic and string types, instances of `mp_number >` are +As well as the usual conversions from arithmetic and string types, instances of `number >` are copy constructible and assignable from: * The [gmp] native types `mpf_t`, `mpz_t`, `mpq_t`. -* The `mp_number` wrappers around those types: `mp_number >`, `mp_number`, `mp_number`. +* The `number` wrappers around those types: `number >`, `number`, `number`. It's also possible to access the underlying `mpf_t` via the `data()` member function of `gmp_float`. @@ -514,7 +514,7 @@ Things you should know when using this type: * Default constructed `gmp_float`s have the value zero (this is the [gmp] library's default behavior). * No changes are made to the [gmp] library's global settings, so this type can be safely mixed with existing [gmp] code. -* This backend supports rvalue-references and is move-aware, making instantiations of `mp_number` on this backend move aware. +* This backend supports rvalue-references and is move-aware, making instantiations of `number` on this backend move aware. * It is not possible to round-trip objects of this type to and from a string and get back exactly the same value. This appears to be a limitation of [gmp]. * Since the underlying [gmp] types have no notion of infinities or NaN's, care should be taken @@ -543,15 +543,15 @@ as a valid floating point number. template class mpfr_float_backend; - typedef mp_number > mpfr_float_50; - typedef mp_number > mpfr_float_100; - typedef mp_number > mpfr_float_500; - typedef mp_number > mpfr_float_1000; - typedef mp_number > mpfr_float; + typedef number > mpfr_float_50; + typedef number > mpfr_float_100; + typedef number > mpfr_float_500; + typedef number > mpfr_float_1000; + typedef number > mpfr_float; }} // namespaces -The `mpfr_float_backend` type is used in conjunction with `mp_number`: It acts as a thin wrapper around the [mpfr] `mpfr_t` +The `mpfr_float_backend` type is used in conjunction with `number`: It acts as a thin wrapper around the [mpfr] `mpfr_t` to provide an real-number type that is a drop-in replacement for the native C++ floating-point types, but with much greater precision. @@ -559,16 +559,16 @@ Type `mpfr_float_backend` can be used at fixed precision by specifying a non-zer at variable precision by setting the template argument to zero. The typedefs mpfr_float_50, mpfr_float_100, mpfr_float_500, mpfr_float_1000 provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision respectively. The typedef mpfr_float provides a variable precision type whose precision can be controlled via the -`mp_number`s member functions. +`number`s member functions. [note This type only provides `numeric_limits` support when the precision is fixed at compile time.] -As well as the usual conversions from arithmetic and string types, instances of `mp_number >` are +As well as the usual conversions from arithmetic and string types, instances of `number >` are copy constructible and assignable from: * The [gmp] native types `mpf_t`, `mpz_t`, `mpq_t`. * The [mpfr] native type `mpfr_t`. -* The `mp_number` wrappers around those types: `mp_number >`, `mp_number >`, `mp_number`, `mp_number`. +* The `number` wrappers around those types: `number >`, `number >`, `number`, `number`. It's also possible to access the underlying `mpf_t` via the data() member function of `gmp_float`. @@ -579,7 +579,7 @@ Things you should know when using this type: * No changes are made to [gmp] or [mpfr] global settings, so this type can coexist with existing [mpfr] or [gmp] code. * The code can equally use [mpir] in place of [gmp] - indeed that is the preferred option on Win32. -* This backend supports rvalue-references and is move-aware, making instantiations of `mp_number` on this backend move aware. +* This backend supports rvalue-references and is move-aware, making instantiations of `number` on this backend move aware. * 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. * Division by zero results in an infinity. @@ -599,12 +599,12 @@ as a valid floating point number. template class cpp_dec_float; - typedef mp_number > cpp_dec_float_50; - typedef mp_number > cpp_dec_float_100; + typedef number > cpp_dec_float_50; + typedef number > cpp_dec_float_100; }} // namespaces -The `cpp_dec_float` back-end is used in conjunction with `mp_number`: It acts as an entirely C++ (header only and dependency free) +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. @@ -625,8 +625,8 @@ 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 `mp_number` instantiated on this type, is convertible to any other `mp_number` instantiated on this type - -for example you can convert from `mp_number >` to `mp_number >`. +* Any `number` instantiated on this type, is convertible to any other `number` instantiated on this type - +for example you can convert from `number >` to `number >`. 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. @@ -690,7 +690,7 @@ The following back-ends provide rational number arithmetic: [[`cpp_rational`][boost/multiprecision/cpp_int.hpp][2][None][An all C++ Boost-licensed implementation.][Slower than [gmp].]] [[`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 `mp_number` integer type.][The expression templates used by `mp_number` end up being "hidden" inside `boost::rational`: performance may well suffer as a result.]] +[[`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] @@ -701,20 +701,20 @@ The following back-ends provide rational number arithmetic: class gmp_rational; - typedef mp_number mpq_rational; + typedef number mpq_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 `mp_number` are copy constructible +As well as the usual conversions from arithmetic and string types, instances of `number` are copy constructible and assignable from: * The [gmp] native types: `mpz_t`, `mpq_t`. -* `mp_number`. +* `number`. -There is also a two-argument constructor that accepts a numerator and denominator (both of type `mp_number`). +There is also a two-argument constructor that accepts a numerator and denominator (both of type `number`). There are also non-member functions: @@ -749,7 +749,7 @@ interpreted as a valid rational number. typedef rational_adapter > cpp_rational_backend; - typedef mp_number cpp_rational; + typedef number cpp_rational; }} // namespaces @@ -788,7 +788,7 @@ interpreted as a valid rational number. namespace boost{ namespace multiprecision{ typedef rational_adpater tommath_rational; - typedef mp_number tom_rational; + typedef number tom_rational; }} // namespaces @@ -826,7 +826,7 @@ needs some improvement in this area. All of the integer types in this library can be used as template arguments to `boost::rational`. -Note that using the library in this way largely negates the effect of the expression templates in `mp_number`. +Note that using the library in this way largely negates the effect of the expression templates in `number`. [endsect] @@ -839,13 +839,13 @@ Note that using the library in this way largely negates the effect of the expres }} -The class template `rational_adapter` is a back-end for `mp_number` which converts any existing integer back-end +The class template `rational_adapter` is a back-end for `number` which converts any existing integer back-end into a rational-number back-end. So for example, given an integer back-end type `MyIntegerBackend`, the use would be something like: - typedef mp_number MyInt; - typedef mp_number > MyRational; + typedef number MyInt; + typedef number > MyRational; MyRational r = 2; r /= 3; @@ -858,7 +858,7 @@ So for example, given an integer back-end type `MyIntegerBackend`, the use would [section:conversions Constructing and Interconverting Between Number Types] -All of the number types that are based on `mp_number` have certain conversion rules in common. +All of the number types that are based on `number` have certain conversion rules in common. In particular: * Any number type can be constructed (or assigned) from any builtin arithmetic type: @@ -921,7 +921,7 @@ In particular: More information on what additional types a backend supports conversions from are given in the tutorial for each backend. -* An `mp_number` can be converted to any built in type, via the `convert_to` member function: +* An `number` can be converted to any built in type, via the `convert_to` member function: mpz_int z(2); int i = z.template convert_to(); // sets i to 2 @@ -968,10 +968,10 @@ The library implements a Miller-Rabin test for primality: #include template - bool miller_rabin_test(const mp_number& n, unsigned trials, Engine& gen); + bool miller_rabin_test(const number& n, unsigned trials, Engine& gen); template - bool miller_rabin_test(const mp_number& n, unsigned trials); + bool miller_rabin_test(const number& n, unsigned trials); These functions perform a Miller-Rabin test for primality, if the result is `false` then /n/ is definitely composite, while if the result is `true` then /n/ is prime with probability ['0.25^trials]. The algorithm used performs some @@ -994,40 +994,40 @@ The following example searches for a prime `p` for which `(p-1)/2` is also proba [section:ref Reference] -[section:mp_number mp_number] +[section:number number] [h4 Synopsis] namespace boost{ namespace multiprecision{ template - class mp_number + class number { - mp_number(); - mp_number(see-below); - mp_number& operator=(see-below); + number(); + number(see-below); + number& operator=(see-below); // Member operators - mp_number& operator+=(const ``['see-below]``&); - mp_number& operator-=(const ``['see-below]``&); - mp_number& operator*=(const ``['see-below]``&); - mp_number& operator/=(const ``['see-below]``&); - mp_number& operator++(); - mp_number& operator--(); - mp_number operator++(int); - mp_number operator--(int); + number& operator+=(const ``['see-below]``&); + number& operator-=(const ``['see-below]``&); + number& operator*=(const ``['see-below]``&); + number& operator/=(const ``['see-below]``&); + number& operator++(); + number& operator--(); + number operator++(int); + number operator--(int); - mp_number& operator%=(const ``['see-below]``&); - mp_number& operator&=(const ``['see-below]``&); - mp_number& operator|=(const ``['see-below]``&); - mp_number& operator^=(const ``['see-below]``&); - mp_number& operator<<=(const ``['integer-type]``&); - mp_number& operator>>=(const ``['integer-type]``&); + number& operator%=(const ``['see-below]``&); + number& operator&=(const ``['see-below]``&); + number& operator|=(const ``['see-below]``&); + number& operator^=(const ``['see-below]``&); + number& operator<<=(const ``['integer-type]``&); + number& operator>>=(const ``['integer-type]``&); // Use in Boolean context: operator ``['convertible-to-bool-type]``()const; // swap: - void swap(mp_number& other); + void swap(number& other); // Sign: bool is_zero()const; int sign()const; @@ -1042,7 +1042,7 @@ The following example searches for a prime `p` for which `(p-1)/2` is also proba unsigned precision()const; void precision(unsigned digits10); // Comparison: - int compare(const mp_number& o)const; + int compare(const number& o)const; template typename enable_if, int>::type compare(const V& o)const; // Access to the underlying implementation: @@ -1074,47 +1074,47 @@ The following example searches for a prime `p` for which `(p-1)/2` is also proba // Swap: template - void swap(mp_number& a, mp_number& b); + void swap(number& a, number& b); // iostream support: template - std::ostream& operator << (std::ostream& os, const mp_number& r); + std::ostream& operator << (std::ostream& os, const number& r); std::ostream& operator << (std::ostream& os, const ``['unmentionable-expression-template-type]``& r); template - std::istream& operator >> (std::istream& is, mp_number& r); + std::istream& operator >> (std::istream& is, number& r); // Non-member function standard library support: - ``['unmentionable-expression-template-type]`` abs (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` fabs (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` sqrt (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` floor (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` ceil (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` trunc (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` itrunc (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` ltrunc (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` lltrunc(const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` round (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` iround (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` lround (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` llround(const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` exp (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` log (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` log10 (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` cos (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` sin (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` tan (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` acos (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` asin (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` atan (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` cosh (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` sinh (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` tanh (const ``['mp_number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` abs (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` fabs (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` sqrt (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` floor (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` ceil (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` trunc (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` itrunc (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` ltrunc (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` lltrunc(const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` round (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` iround (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` lround (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` llround(const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` exp (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` log (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` log10 (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` cos (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` sin (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` tan (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` acos (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` asin (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` atan (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` cosh (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` sinh (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` tanh (const ``['number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` ldexp (const ``['mp_number-or-expression-template-type]``&, int); - ``['unmentionable-expression-template-type]`` frexp (const ``['mp_number-or-expression-template-type]``&, int*); - ``['unmentionable-expression-template-type]`` pow (const ``['mp_number-or-expression-template-type]``&, const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` fmod (const ``['mp_number-or-expression-template-type]``&, const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` atan2 (const ``['mp_number-or-expression-template-type]``&, const ``['mp_number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` ldexp (const ``['number-or-expression-template-type]``&, int); + ``['unmentionable-expression-template-type]`` frexp (const ``['number-or-expression-template-type]``&, int*); + ``['unmentionable-expression-template-type]`` pow (const ``['number-or-expression-template-type]``&, const ``['number-or-expression-template-type]``&); + ``['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]``&); // Traits support: template @@ -1123,40 +1123,40 @@ The following example searches for a prime `p` for which `(p-1)/2` is also proba struct number_category; // Integer specific functions: - ``['unmentionable-expression-template-type]`` pow(const ``['mp_number-or-expression-template-type]``&, unsigned); - ``['unmentionable-expression-template-type]`` powm(const ``['mp_number-or-expression-template-type]``& b, const ``['mp_number-or-expression-template-type]``& p, const ``['mp_number-or-expression-template-type]``& m); + ``['unmentionable-expression-template-type]`` pow(const ``['number-or-expression-template-type]``&, unsigned); + ``['unmentionable-expression-template-type]`` powm(const ``['number-or-expression-template-type]``& b, const ``['number-or-expression-template-type]``& p, const ``['number-or-expression-template-type]``& m); template - void divide_qr(const ``['mp_number-or-expression-template-type]``& x, const ``['mp_number-or-expression-template-type]``& y, - mp_number& q, mp_number& r); + void divide_qr(const ``['number-or-expression-template-type]``& x, const ``['number-or-expression-template-type]``& y, + number& q, number& r); template - Integer integer_modulus(const ``['mp_number-or-expression-template-type]``& x, Integer val); - unsigned lsb(const ``['mp_number-or-expression-template-type]``& x); + Integer integer_modulus(const ``['number-or-expression-template-type]``& x, Integer val); + unsigned lsb(const ``['number-or-expression-template-type]``& x); template - bool bit_test(const mp_number& val, unsigned index); + bool bit_test(const number& val, unsigned index); template - mp_number& bit_set(mp_number& val, unsigned index); + number& bit_set(number& val, unsigned index); template - mp_number& bit_unset(mp_number& val, unsigned index); + number& bit_unset(number& val, unsigned index); template - mp_number& bit_flip(mp_number& val, unsigned index); + number& bit_flip(number& val, unsigned index); template - bool miller_rabin_test(const ``['mp_number-or-expression-template-type]``& n, unsigned trials, Engine& gen); - bool miller_rabin_test(const ``['mp_number-or-expression-template-type]``& n, unsigned trials); + bool miller_rabin_test(const ``['number-or-expression-template-type]``& n, unsigned trials, Engine& gen); + bool miller_rabin_test(const ``['number-or-expression-template-type]``& n, unsigned trials); // Rational number support: - typename component_type<``['mp_number-or-expression-template-type]``>::type numerator (const ``['mp_number-or-expression-template-type]``&); - typename component_type<``['mp_number-or-expression-template-type]``>::type denominator(const ``['mp_number-or-expression-template-type]``&); + typename component_type<``['number-or-expression-template-type]``>::type numerator (const ``['number-or-expression-template-type]``&); + typename component_type<``['number-or-expression-template-type]``>::type denominator(const ``['number-or-expression-template-type]``&); }} // namespaces namespace boost{ namespace math{ // Boost.Math interoperability functions: - int fpclassify (const ``['mp_number-or-expression-template-type]``&, int); - bool isfinite (const ``['mp_number-or-expression-template-type]``&, int); - bool isnan (const ``['mp_number-or-expression-template-type]``&, int); - bool isinf (const ``['mp_number-or-expression-template-type]``&, int); - bool isnormal (const ``['mp_number-or-expression-template-type]``&, int); + int fpclassify (const ``['number-or-expression-template-type]``&, int); + bool isfinite (const ``['number-or-expression-template-type]``&, int); + bool isnan (const ``['number-or-expression-template-type]``&, int); + bool isinf (const ``['number-or-expression-template-type]``&, int); + bool isnormal (const ``['number-or-expression-template-type]``&, int); }} // namespaces @@ -1174,77 +1174,77 @@ The following example searches for a prime `p` for which `(p-1)/2` is also proba [h4 Description] template - class mp_number; + class number; -Class `mp_number` has two template arguments: +Class `number` has two template arguments: [variablelist [[Backend][The actual arithmetic back-end that does all the work.]] [[ExpressionTemplates][A Boolean value: when true, then expression templates are enabled, otherwise they are disabled.]] ] - mp_number(); - mp_number(see-below); - mp_number& operator=(see-below); + number(); + number(see-below); + number& operator=(see-below); -Type `mp_number` is default constructible, and both copy constructible and assignable from: +Type `number` is default constructible, and both copy constructible and assignable from: * Itself. * An expression template which is the result of one of the arithmetic operators. * Any builtin arithmetic type. * A `std::string` or any type which is convertible to `const char*`. * Any type that the Backend is constructible or assignable from. -* An rvalue reference to another `mp_number`. Move-semantics are used for construction if the backend also +* An rvalue reference to another `number`. Move-semantics are used for construction if the backend also supports rvalue reference construction. In the case of assignment, move semantics are always supported when the argument is an rvalue reference irrespective of the backend. In addition, if the type has multiple components (for example rational or complex number types), then there is a two argument constructor: - mp_number(arg1, arg2); + number(arg1, arg2); Where the two args must either be arithmetic types, or types that are convertible to the two components of `this`. - mp_number& operator+=(const ``['see-below]``&); - mp_number& operator-=(const ``['see-below]``&); - mp_number& operator*=(const ``['see-below]``&); - mp_number& operator/=(const ``['see-below]``&); - mp_number& operator++(); - mp_number& operator--(); - mp_number operator++(int); - mp_number operator--(int); + number& operator+=(const ``['see-below]``&); + number& operator-=(const ``['see-below]``&); + number& operator*=(const ``['see-below]``&); + number& operator/=(const ``['see-below]``&); + number& operator++(); + number& operator--(); + number operator++(int); + number operator--(int); // Integer only operations: - mp_number& operator%=(const ``['see-below]``&); - mp_number& operator&=(const ``['see-below]``&); - mp_number& operator|=(const ``['see-below]``&); - mp_number& operator^=(const ``['see-below]``&); - mp_number& operator<<=(const ``['integer-type]``&); - mp_number& operator>>=(const ``['integer-type]``&); + number& operator%=(const ``['see-below]``&); + number& operator&=(const ``['see-below]``&); + number& operator|=(const ``['see-below]``&); + number& operator^=(const ``['see-below]``&); + number& operator<<=(const ``['integer-type]``&); + number& operator>>=(const ``['integer-type]``&); These operators all take their usual arithmetic meanings. The arguments to these operators is either: -* Another `mp_number`. +* Another `number`. * A builtin arithmetic type. -* An expression template derived from `mp_number`. +* An expression template derived from `number`. For the left and right shift operations, the argument must be a builtin integer type with a positive value (negative values result in a `std::runtime_error` being thrown). Note that all the types involved in the expression must evaluate to the same type - which is to say -we cannot mix an `mp_number` with an `mp_number` where B1 and B2 are different types. +we cannot mix an `number` with an `number` where B1 and B2 are different types. operator ``['convertible-to-bool-type]``()const; -Returns an ['unmentionable-type] that is usable in Boolean contexts (this allows `mp_number` to be used in any +Returns an ['unmentionable-type] that is usable in Boolean contexts (this allows `number` to be used in any Boolean context - if statements, conditional statements, or as an argument to a logical operator - without -type `mp_number` being convertible to type `bool`. +type `number` being convertible to type `bool`. -This operator also enables the use of `mp_number` with any of the following operators: +This operator also enables the use of `number` with any of the following operators: `!`, `||`, `&&` and `?:`. - void swap(mp_number& other); + void swap(number& other); Swaps `*this` with `other`. @@ -1277,7 +1277,7 @@ Optionally other types may also be supported by specific `Backend` types. These functions are only available if the Backend template parameter supports runtime changes to precision. They get and set the default precision and the precision of `*this` respectively. - int compare(const mp_number& o)const; + int compare(const number& o)const; template typename enable_if, int>::type compare(const V& other)const; @@ -1320,19 +1320,19 @@ These operators all take their usual arithmetic meanings. The arguments to these functions must contain at least one of the following: -* An `mp_number`. -* An expression template type derived from `mp_number`. +* An `number`. +* An expression template type derived from `number`. In addition, one of the two arguments may be a builtin arithmetic type. The return type of these operators is either: * An ['unmentionable-type] expression template type when `ExpressionTemplates` is `true`. -* Type `mp_number` when `ExpressionTemplates` is `false`. +* Type `number` when `ExpressionTemplates` is `false`. * Type `bool` if the operator is a comparison operator. Note that all the types involved in the expression must evaluate to the same type - which is to say -we cannot mix an `mp_number` with an `mp_number` where B1 and B2 are different types. +we cannot mix an `number` with an `number` where B1 and B2 are different types. Finally note that the second argument to the left and right shift operations must be a builtin integer type, and that the argument must be positive (negative arguments result in a `std::runtime_error` being thrown). @@ -1340,60 +1340,60 @@ and that the argument must be positive (negative arguments result in a `std::run [h4 swap] template - void swap(mp_number& a, mp_number& b); + void swap(number& a, number& b); Swaps `a` and `b`. [h4 Iostream Support] template - std::ostream& operator << (std::ostream& os, const mp_number& r); + std::ostream& operator << (std::ostream& os, const number& r); template std::ostream& operator << (std::ostream& os, const unmentionable-expression-template& r); template - inline std::istream& operator >> (std::istream& is, mp_number& r) + inline std::istream& operator >> (std::istream& is, number& r) -These operators provided formatted input-output operations on `mp_number` types, and expression templates derived from them. +These operators provided formatted input-output operations on `number` types, and expression templates derived from them. It's down to the back-end type to actually implement string conversion. However, the back-ends provided with this library support all of the iostream formatting flags, field width and precision settings. [h4 Non-member standard library function support] - ``['unmentionable-expression-template-type]`` abs (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` fabs (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` sqrt (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` floor (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` ceil (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` trunc (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` itrunc (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` ltrunc (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` lltrunc(const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` round (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` iround (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` lround (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` llround(const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` exp (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` log (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` log10 (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` cos (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` sin (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` tan (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` acos (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` asin (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` atan (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` cosh (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` sinh (const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` tanh (const ``['mp_number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` abs (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` fabs (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` sqrt (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` floor (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` ceil (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` trunc (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` itrunc (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` ltrunc (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` lltrunc(const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` round (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` iround (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` lround (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` llround(const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` exp (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` log (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` log10 (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` cos (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` sin (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` tan (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` acos (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` asin (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` atan (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` cosh (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` sinh (const ``['number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` tanh (const ``['number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` ldexp (const ``['mp_number-or-expression-template-type]``&, int); - ``['unmentionable-expression-template-type]`` frexp (const ``['mp_number-or-expression-template-type]``&, int*); - ``['unmentionable-expression-template-type]`` pow (const ``['mp_number-or-expression-template-type]``&, const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` fmod (const ``['mp_number-or-expression-template-type]``&, const ``['mp_number-or-expression-template-type]``&); - ``['unmentionable-expression-template-type]`` atan2 (const ``['mp_number-or-expression-template-type]``&, const ``['mp_number-or-expression-template-type]``&); + ``['unmentionable-expression-template-type]`` ldexp (const ``['number-or-expression-template-type]``&, int); + ``['unmentionable-expression-template-type]`` frexp (const ``['number-or-expression-template-type]``&, int*); + ``['unmentionable-expression-template-type]`` pow (const ``['number-or-expression-template-type]``&, const ``['number-or-expression-template-type]``&); + ``['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 `mp_number` or -an expression template derived from it; If the argument is of type `mp_number` then that is also the return type, +These functions all behave exactly as their standard library counterparts do: their argument is either an instance of `number` or +an expression template derived from it; If the argument is of type `number` then that is also the return type, otherwise the return type is an expression template. These functions are normally implemented by the Backend type. However, default versions are provided for Backend types that @@ -1421,53 +1421,53 @@ A traits class that inherits from `mpl::int_` where `N` is one of the enumera [h4 Integer functions] - ``['unmentionable-expression-template-type]`` pow(const ``['mp_number-or-expression-template-type]``& b, unsigned p); + ``['unmentionable-expression-template-type]`` pow(const ``['number-or-expression-template-type]``& b, unsigned p); Returns ['b[super p]] as an expression template. Note that this function should be used with extreme care as the result can grow so large as to take "effectively forever" to compute, or else simply run the host machine out of memory. - ``['unmentionable-expression-template-type]`` powm(const ``['mp_number-or-expression-template-type]``& b, const ``['mp_number-or-expression-template-type]``& p, const ``['mp_number-or-expression-template-type]``& m); + ``['unmentionable-expression-template-type]`` powm(const ``['number-or-expression-template-type]``& b, const ``['number-or-expression-template-type]``& p, const ``['number-or-expression-template-type]``& m); Returns ['b[super p] mod m] as an expression template. template - bool divide_qr(const ``['mp_number-or-expression-template-type]``& x, const ``['mp_number-or-expression-template-type]``& y, - mp_number& q, mp_number& r); + bool divide_qr(const ``['number-or-expression-template-type]``& x, const ``['number-or-expression-template-type]``& y, + number& q, number& r); Divides x by y and returns both the quotient and remainder. After the call `q = x / y` and `r = x % y`. template - Integer integer_modulus(const ``['mp_number-or-expression-template-type]``& x, Integer val); + Integer integer_modulus(const ``['number-or-expression-template-type]``& x, Integer val); Returns the absolute value of `x % val`. - unsigned lsb(const ``['mp_number-or-expression-template-type]``& x); + unsigned lsb(const ``['number-or-expression-template-type]``& x); Returns the index of the least significant bit that is set to 1. template - bool bit_test(const mp_number& val, unsigned index); + bool bit_test(const number& val, unsigned index); Returns `true` if the bit at /index/ in /val/ is set. template - mp_number& bit_set(mp_number& val, unsigned index); + number& bit_set(number& val, unsigned index); Sets the bit at /index/ in /val/, and returns /val/. template - mp_number& bit_unset(mp_number& val, unsigned index); + number& bit_unset(number& val, unsigned index); Unsets the bit at /index/ in /val/, and returns /val/. template - mp_number& bit_flip(mp_number& val, unsigned index); + number& bit_flip(number& val, unsigned index); Flips the bit at /index/ in /val/, and returns /val/. template - bool miller_rabin_test(const ``['mp_number-or-expression-template-type]``& n, unsigned trials, Engine& gen); - bool miller_rabin_test(const ``['mp_number-or-expression-template-type]``& n, unsigned trials); + bool miller_rabin_test(const ``['number-or-expression-template-type]``& n, unsigned trials, Engine& gen); + bool miller_rabin_test(const ``['number-or-expression-template-type]``& n, unsigned trials); Tests to see if the number /n/ is probably prime - the test excludes the vast majority of composite numbers by excluding small prime factors and performing a single Fermat test. Then performs /trials/ Miller-Rabin @@ -1476,8 +1476,8 @@ probability of it being composite less than 0.25^trials. [h4 Rational Number Functions] - typename component_type<``['mp_number-or-expression-template-type]``>::type numerator (const ``['mp_number-or-expression-template-type]``&); - typename component_type<``['mp_number-or-expression-template-type]``>::type denominator(const ``['mp_number-or-expression-template-type]``&); + typename component_type<``['number-or-expression-template-type]``>::type numerator (const ``['number-or-expression-template-type]``&); + typename component_type<``['number-or-expression-template-type]``>::type denominator(const ``['number-or-expression-template-type]``&); These functions return the numerator and denominator of a rational number respectively. @@ -1485,11 +1485,11 @@ These functions return the numerator and denominator of a rational number respec namespace boost{ namespace math{ - int fpclassify (const ``['mp_number-or-expression-template-type]``&, int); - bool isfinite (const ``['mp_number-or-expression-template-type]``&, int); - bool isnan (const ``['mp_number-or-expression-template-type]``&, int); - bool isinf (const ``['mp_number-or-expression-template-type]``&, int); - bool isnormal (const ``['mp_number-or-expression-template-type]``&, int); + int fpclassify (const ``['number-or-expression-template-type]``&, int); + bool isfinite (const ``['number-or-expression-template-type]``&, int); + bool isnan (const ``['number-or-expression-template-type]``&, int); + bool isinf (const ``['number-or-expression-template-type]``&, int); + bool isnormal (const ``['number-or-expression-template-type]``&, int); }} // namespaces @@ -1510,7 +1510,7 @@ specialized or overloaded to ensure interoperability. } -Class template `std::numeric_limits` is specialized for all instantiations of `mp_number` whose precision is known at compile time, plus those +Class template `std::numeric_limits` is specialized for all instantiations of `number` whose precision is known at compile time, plus those types whose precision is unlimited (though it is much less useful in those cases). It is not specialized for types whose precision can vary at compile time (such as `mpf_float`). @@ -1523,21 +1523,21 @@ whose precision can vary at compile time (such as `mpf_float`). template > struct cpp_int_backend; - typedef mp_number > cpp_int; // arbitrary precision integer + typedef number > cpp_int; // arbitrary precision integer typedef rational_adapter > cpp_rational_backend; - typedef mp_number cpp_rational; // arbitrary precision rational number + typedef number cpp_rational; // arbitrary precision rational number // Fixed precision unsigned types: - typedef mp_number, false> mp_uint128_t; - typedef mp_number, false> mp_uint256_t; - typedef mp_number, false> mp_uint512_t; - typedef mp_number, false> mp_uint1024_t; + typedef number, false> uint128_t; + typedef number, false> uint256_t; + typedef number, false> uint512_t; + typedef number, false> uint1024_t; // Fixed precision signed types: - typedef mp_number, false> mp_int128_t; - typedef mp_number, false> mp_int256_t; - typedef mp_number, false> mp_int512_t; - typedef mp_number, false> mp_int1024_t; + typedef number, false> int128_t; + typedef number, false> int256_t; + typedef number, false> int512_t; + typedef number, false> int1024_t; }} // namespaces @@ -1572,7 +1572,7 @@ More information on this type can be found in the [link boost_multiprecision.tut class gmp_int; - typedef mp_number mpz_int; + typedef number mpz_int; }} // namespaces @@ -1592,7 +1592,7 @@ More information on this type can be found in the [link boost_multiprecision.tut class tommath_int; - typedef mp_number tom_int; + typedef number tom_int; }} // namespaces @@ -1613,11 +1613,11 @@ More information on this type can be found in the [link boost_multiprecision.tut template class gmp_float; - typedef mp_number > mpf_float_50; - typedef mp_number > mpf_float_100; - typedef mp_number > mpf_float_500; - typedef mp_number > mpf_float_1000; - typedef mp_number > mpf_float; + typedef number > mpf_float_50; + typedef number > mpf_float_100; + typedef number > mpf_float_500; + typedef number > mpf_float_1000; + typedef number > mpf_float; }} // namespaces @@ -1626,8 +1626,8 @@ Its members and non-member functions are deliberately not documented: these are to change. The class takes a single template parameter - `Digits10` - which is the number of decimal digits precision the type -should support. When this parameter is zero, then the precision can be set at runtime via `mp_number::default_precision` -and `mp_number::precision`. Note that this type does not in any way change the GMP library's global state (for example +should support. When this parameter is zero, then the precision can be set at runtime via `number::default_precision` +and `number::precision`. Note that this type does not in any way change the GMP library's global state (for example it does not change the default precision of the mpf_t data type), therefore you can safely mix this type with existing code that uses GMP, and also mix `gmp_float`s of differing precision. @@ -1644,11 +1644,11 @@ More information on this type can be found in the [link boost_multiprecision.tut template class mpfr_float_backend; - typedef mp_number > mpfr_float_50; - typedef mp_number > mpfr_float_100; - typedef mp_number > mpfr_float_500; - typedef mp_number > mpfr_float_1000; - typedef mp_number > mpfr_float; + typedef number > mpfr_float_50; + typedef number > mpfr_float_100; + typedef number > mpfr_float_500; + typedef number > mpfr_float_1000; + typedef number > mpfr_float; }} // namespaces @@ -1657,8 +1657,8 @@ Its members and non-member functions are deliberately not documented: these are to change. The class takes a single template parameter - `Digits10` - which is the number of decimal digits precision the type -should support. When this parameter is zero, then the precision can be set at runtime via `mp_number::default_precision` -and `mp_number::precision`. Note that this type does not in any way change the GMP or MPFR library's global state (for example +should support. When this parameter is zero, then the precision can be set at runtime via `number::default_precision` +and `number::precision`. Note that this type does not in any way change the GMP or MPFR library's global state (for example it does not change the default precision of the mpfr_t data type), therefore you can safely mix this type with existing code that uses GMP or MPFR, and also mix `mpfr_float_backend`s of differing precision. @@ -1675,8 +1675,8 @@ More information on this type can be found in the [link boost_multiprecision.tut template class cpp_dec_float; - typedef mp_number > cpp_dec_float_50; - typedef mp_number > cpp_dec_float_100; + typedef number > cpp_dec_float_50; + typedef number > cpp_dec_float_100; }} // namespaces @@ -1696,13 +1696,13 @@ More information on this type can be found in the [link boost_multiprecision.tut [section:backendconc Backend Requirements] -The requirements on the `Backend` template argument to `mp_number` are split up into +The requirements on the `Backend` template argument to `number` are split up into compulsory requirements, and optional requirements that are either to improve performance or provide optional features. TODO: Add optional construction support, add throws specification, clarify what compulsory means. -In the following tables, type B is the `Backend` template arument to `mp_number`, `b` and `b2` are +In the following tables, type B is the `Backend` template arument to `number`, `b` and `b2` are a variables of type B, `cb` and `cb2` are constant variables of type B, `a` is a variable of Arithmetic type, `s` is a variable of type `const char*`, `ui` is a variable of type `unsigned`, `bb` is a variable of type `bool`, `pa` is a variable of type pointer-to-arithmetic-type, `exp` is a variable of type `B::exp_type`, @@ -1880,7 +1880,7 @@ in point of fact this naming convention shouldn't be necessary, but rather works [[gmp.hpp][Defines all [gmp] related backends.]] [[integer_ops.hpp][Integer specific non-member functions.]] [[miller_rabin.hpp][Miller Rabin primality testing code.]] -[[mp_number.hpp][Defines the `mp_number` backend, is included by all the backend headers.]] +[[number.hpp][Defines the `number` backend, is included by all the backend headers.]] [[mpfr.hpp][Defines the mpfr_float_backend backend.]] [[random.hpp][Defines code to interoperate with Boost.Random.]] [[rational_adapter.hpp][Defines the `rational_adapter` backend.]] @@ -1895,7 +1895,7 @@ in point of fact this naming convention shouldn't be necessary, but rather works [[detail/cpp_int_core.hpp][Platform and peformance tuning for the `cpp_int` backend.]] [[detail/default_ops.hpp][Default versions of the optional backend non-member functions.]] [[detail/generic_interconvert.hpp][Generic interconversion routines.]] -[[detail/mp_number_base.hpp][All the expression template code, metaprogramming, and operator overloads for `mp_number`.]] +[[detail/number_base.hpp][All the expression template code, metaprogramming, and operator overloads for `number`.]] [[detail/no_et_ops.hpp][The non-expression template operators.]] [[defail/functions/constants.hpp][Defines constants used by the floating point functions.]] [[detail/functions/pow.hpp][Defines default versions of the power and exponential related floating point functions.]] @@ -1959,8 +1959,8 @@ Windows Vista machine. [[cpp_int (256-bit cache)][1.29367(0.442451s)]] [[cpp_int (512-bit cache)][1.08821(0.37218s)]] [[cpp_int (1024-bit cache)][1.07902(0.369037s)]] -[[mp_int1024_t][1.02616(0.35096s)]] -[[mp_int1024_t (no Expression templates)][1(0.342011s)]] +[[int1024_t][1.02616(0.35096s)]] +[[int1024_t (no Expression templates)][1(0.342011s)]] [[tom_int][3.74233(1.27992s)]] [[tom_int (no Expression templates)][3.97646(1.35999s)]] ] @@ -2292,7 +2292,7 @@ More a list of what ['could] be done, rather than what ['should] be done (which * Can the non-expression template operators be further optimised with rvalue reference support? * Can any functions - in particular value initialization - be made `constexp`? -* Can we differentiate between explicit and implicit conversions in the mp_number constructor (may need some new type traits)? +* Can we differentiate between explicit and implicit conversions in the number constructor (may need some new type traits)? * 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? diff --git a/example/cpp_int_snips.cpp b/example/cpp_int_snips.cpp index 191fcecb..a2818740 100644 --- a/example/cpp_int_snips.cpp +++ b/example/cpp_int_snips.cpp @@ -13,7 +13,7 @@ void t1() using namespace boost::multiprecision; - mp_int128_t v = 1; + int128_t v = 1; // Do some fixed precision arithmetic: for(unsigned i = 1; i <= 20; ++i) diff --git a/example/floating_point_examples.cpp b/example/floating_point_examples.cpp index 37761d94..2200b73d 100644 --- a/example/floating_point_examples.cpp +++ b/example/floating_point_examples.cpp @@ -343,7 +343,7 @@ private: /*` In this example we'll look at polynomial evaluation, this is not only an important -use case, but it's one that `mp_number` performs particularly well at because the +use case, but it's one that `number` performs particularly well at because the expression templates ['completely eliminate all temporaries] from a [@http://en.wikipedia.org/wiki/Horner%27s_method Horner polynomial evaluation scheme]. @@ -353,7 +353,7 @@ The following code evaluates `sin(x)` as a polynomial, accurate to at least 64 d */ using boost::multiprecision::cpp_dec_float; -typedef boost::multiprecision::mp_number > mp_type; +typedef boost::multiprecision::number > mp_type; mp_type mysin(const mp_type& x) { diff --git a/example/integer_examples.cpp b/example/integer_examples.cpp index f57e76e8..0b2edbbd 100644 --- a/example/integer_examples.cpp +++ b/example/integer_examples.cpp @@ -32,7 +32,7 @@ void print_factorials() // large the largest is, we'll be able to "pretty format" the results. // // Calculate the largest number that will fit inside 128 bits, we could - // also have used numeric_limits::max() for this value: + // also have used numeric_limits::max() for this value: cpp_int limit = (cpp_int(1) << 128) - 1; // // Our table of values: diff --git a/include/boost/multiprecision/concepts/mp_number_archetypes.hpp b/include/boost/multiprecision/concepts/mp_number_archetypes.hpp index d10449cc..bb2c8678 100644 --- a/include/boost/multiprecision/concepts/mp_number_archetypes.hpp +++ b/include/boost/multiprecision/concepts/mp_number_archetypes.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -195,17 +195,17 @@ inline int eval_fpclassify(const mp_number_backend_float_architype& arg) return (boost::math::fpclassify)(arg.m_value); } -typedef boost::multiprecision::mp_number mp_number_float_architype; +typedef boost::multiprecision::number mp_number_float_architype; }}} // namespaces namespace std{ template -class numeric_limits > : public std::numeric_limits +class numeric_limits > : public std::numeric_limits { typedef std::numeric_limits base_type; - typedef boost::multiprecision::mp_number number_type; + typedef boost::multiprecision::number number_type; public: static number_type (min)() BOOST_NOEXCEPT { return (base_type::min)(); } static number_type (max)() BOOST_NOEXCEPT { return (base_type::max)(); } diff --git a/include/boost/multiprecision/cpp_dec_float.hpp b/include/boost/multiprecision/cpp_dec_float.hpp index 3110088a..f8115b4a 100644 --- a/include/boost/multiprecision/cpp_dec_float.hpp +++ b/include/boost/multiprecision/cpp_dec_float.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include // @@ -1342,9 +1342,9 @@ int cpp_dec_float::compare(const cpp_dec_float& v) const BOOST_NOEXCEP else if(exp != v.exp) { // The signs are the same and the exponents are different. - const int val_cmp_exp = ((exp < v.exp) ? 1 : -1); + const int val_cexpression = ((exp < v.exp) ? 1 : -1); - return (neg ? val_cmp_exp : -val_cmp_exp); + return (neg ? val_cexpression : -val_cexpression); } else { @@ -2730,7 +2730,7 @@ inline void eval_trunc(cpp_dec_float& result, const cpp_dec_float(%1%)", 0, mp_number >(x), 0, boost::math::policies::policy<>()).backend(); + result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number >(x), 0, boost::math::policies::policy<>()).backend(); return; } else if(x.isint()) @@ -2842,15 +2842,15 @@ inline int eval_get_sign(const cpp_dec_float& val) BOOST_NOEXCEPT using boost::multiprecision::backends::cpp_dec_float; -typedef mp_number > cpp_dec_float_50; -typedef mp_number > cpp_dec_float_100; +typedef number > cpp_dec_float_50; +typedef number > cpp_dec_float_100; }} namespace std { template - class numeric_limits, ExpressionTemplates> > + class numeric_limits, ExpressionTemplates> > { public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; @@ -2877,63 +2877,63 @@ namespace std BOOST_STATIC_CONSTEXPR bool traps = false; BOOST_STATIC_CONSTEXPR bool tinyness_before = false; - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> (min) (void) { return (boost::multiprecision::cpp_dec_float::min)(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> (max) (void) { return (boost::multiprecision::cpp_dec_float::max)(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> lowest (void) { return boost::multiprecision::cpp_dec_float::zero(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> epsilon (void) { return boost::multiprecision::cpp_dec_float::eps(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> round_error (void) { return 0.5L; } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> infinity (void) { return boost::multiprecision::cpp_dec_float::inf(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> quiet_NaN (void) { return boost::multiprecision::cpp_dec_float::nan(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> signaling_NaN(void) { return boost::multiprecision::cpp_dec_float::zero(); } - BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> denorm_min (void) { return boost::multiprecision::cpp_dec_float::zero(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> (min) (void) { return (boost::multiprecision::cpp_dec_float::min)(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> (max) (void) { return (boost::multiprecision::cpp_dec_float::max)(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> lowest (void) { return boost::multiprecision::cpp_dec_float::zero(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> epsilon (void) { return boost::multiprecision::cpp_dec_float::eps(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> round_error (void) { return 0.5L; } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> infinity (void) { return boost::multiprecision::cpp_dec_float::inf(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> quiet_NaN (void) { return boost::multiprecision::cpp_dec_float::nan(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> signaling_NaN(void) { return boost::multiprecision::cpp_dec_float::zero(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::number, ExpressionTemplates> denorm_min (void) { return boost::multiprecision::cpp_dec_float::zero(); } }; #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif } @@ -2943,7 +2943,7 @@ namespace boost{ namespace math{ namespace policies{ template -struct precision< boost::multiprecision::mp_number, ExpressionTemplates>, Policy> +struct precision< boost::multiprecision::number, 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. diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp index 3873720b..9a4e771b 100644 --- a/include/boost/multiprecision/cpp_int.hpp +++ b/include/boost/multiprecision/cpp_int.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -2940,21 +2940,21 @@ using boost::multiprecision::backends::cpp_int_backend; template struct number_category > : public mpl::int_{}; -typedef mp_number > cpp_int; +typedef number > cpp_int; typedef rational_adapter > cpp_rational_backend; -typedef mp_number cpp_rational; +typedef number cpp_rational; // Fixed precision unsigned types: -typedef mp_number, false> mp_uint128_t; -typedef mp_number, false> mp_uint256_t; -typedef mp_number, false> mp_uint512_t; -typedef mp_number, false> mp_uint1024_t; +typedef number, false> uint128_t; +typedef number, false> uint256_t; +typedef number, false> uint512_t; +typedef number, false> uint1024_t; // Fixed precision signed types: -typedef mp_number, false> mp_int128_t; -typedef mp_number, false> mp_int256_t; -typedef mp_number, false> mp_int512_t; -typedef mp_number, false> mp_int1024_t; +typedef number, false> int128_t; +typedef number, false> int256_t; +typedef number, false> int512_t; +typedef number, false> int1024_t; #ifdef BOOST_MSVC #pragma warning(pop) @@ -2968,9 +2968,9 @@ typedef mp_number, false> mp_int1024_t; namespace std{ template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; @@ -3020,56 +3020,56 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; struct inititializer { @@ -3144,61 +3144,61 @@ public: }; template -const typename numeric_limits, ExpressionTemplates> >::inititializer numeric_limits, ExpressionTemplates> >::init; +const typename numeric_limits, ExpressionTemplates> >::inititializer numeric_limits, ExpressionTemplates> >::init; #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; struct inititializer { @@ -3272,54 +3272,54 @@ public: }; template -const typename numeric_limits, ExpressionTemplates> >::inititializer numeric_limits, ExpressionTemplates> >::init; +const typename numeric_limits, ExpressionTemplates> >::inititializer numeric_limits, ExpressionTemplates> >::init; #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif diff --git a/include/boost/multiprecision/depricated/arithmetic_backend.hpp b/include/boost/multiprecision/depricated/arithmetic_backend.hpp index 9925d3f8..0f6e4c02 100644 --- a/include/boost/multiprecision/depricated/arithmetic_backend.hpp +++ b/include/boost/multiprecision/depricated/arithmetic_backend.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace boost{ namespace multiprecision{ @@ -128,10 +128,10 @@ using boost::multiprecision::backends::arithmetic_backend; namespace std{ template -class numeric_limits, ExpressionTemplates > > : public std::numeric_limits +class numeric_limits, ExpressionTemplates > > : public std::numeric_limits { typedef std::numeric_limits base_type; - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_NOEXCEPT { return (base_type::min)(); } BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_NOEXCEPT { return (base_type::max)(); } diff --git a/include/boost/multiprecision/depricated/fixed_int.hpp b/include/boost/multiprecision/depricated/fixed_int.hpp index 80be2036..c12fa3a8 100644 --- a/include/boost/multiprecision/depricated/fixed_int.hpp +++ b/include/boost/multiprecision/depricated/fixed_int.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -1504,13 +1504,13 @@ inline void eval_lcm(fixed_int& result, const fixed_int struct number_category > : public mpl::int_{}; -typedef mp_number > mp_uint128_t; -typedef mp_number > mp_uint256_t; -typedef mp_number > mp_uint512_t; +typedef number > uint128_t; +typedef number > uint256_t; +typedef number > uint512_t; -typedef mp_number > mp_int128_t; -typedef mp_number > mp_int256_t; -typedef mp_number > mp_int512_t; +typedef number > int128_t; +typedef number > int256_t; +typedef number > int512_t; }} // namespaces @@ -1518,16 +1518,16 @@ typedef mp_number > mp_int512_t; namespace std{ template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; struct initializer { initializer() { - (std::numeric_limits > >::min)(); - (std::numeric_limits > >::max)(); + (std::numeric_limits > >::min)(); + (std::numeric_limits > >::max)(); } void do_nothing()const{} }; @@ -1592,8 +1592,8 @@ public: }; template -typename numeric_limits, ExpressionTemplates> >::initializer const - numeric_limits, ExpressionTemplates> >::init; +typename numeric_limits, ExpressionTemplates> >::initializer const + numeric_limits, ExpressionTemplates> >::init; } #endif diff --git a/include/boost/multiprecision/detail/big_lanczos.hpp b/include/boost/multiprecision/detail/big_lanczos.hpp index 998d5dca..c3cb1461 100644 --- a/include/boost/multiprecision/detail/big_lanczos.hpp +++ b/include/boost/multiprecision/detail/big_lanczos.hpp @@ -17,9 +17,9 @@ template struct lanczos; template -struct lanczos, Policy> +struct lanczos, Policy> { - typedef typename boost::math::policies::precision, Policy>::type precision_type; + typedef typename boost::math::policies::precision, Policy>::type precision_type; typedef typename mpl::if_c< precision_type::value <= 73, lanczos13UDT, diff --git a/include/boost/multiprecision/detail/cpp_int_trivial_ops.hpp b/include/boost/multiprecision/detail/cpp_int_trivial_ops.hpp index f2700c5e..47f9147a 100644 --- a/include/boost/multiprecision/detail/cpp_int_trivial_ops.hpp +++ b/include/boost/multiprecision/detail/cpp_int_trivial_ops.hpp @@ -10,6 +10,14 @@ namespace boost{ namespace multiprecision{ namespace backends{ +#ifdef BOOST_MSVC +#pragma warning(push) + // C4389: signed/unsigned mismatch + // C4127: conditional expression is constant + // C4018: signed/unsigned mismatch +#pragma warning(disable:4127 4018 4389) +#endif + template BOOST_FORCEINLINE bool eval_eq(const cpp_int_backend& a, const cpp_int_backend& b) BOOST_NOEXCEPT { @@ -357,10 +365,6 @@ BOOST_FORCEINLINE void eval_lcm(cpp_int_backend& re *result.limbs() = boost::math::lcm(*a.limbs(), *b.limbs()); } -#ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable:4127 4018) -#endif template inline void eval_convert_to(R* result, const cpp_int_backend& val) { diff --git a/include/boost/multiprecision/detail/default_ops.hpp b/include/boost/multiprecision/detail/default_ops.hpp index bf56825b..becb7cb4 100644 --- a/include/boost/multiprecision/detail/default_ops.hpp +++ b/include/boost/multiprecision/detail/default_ops.hpp @@ -7,7 +7,7 @@ #define BOOST_MATH_BIG_NUM_DEF_OPS #include -#include +#include #include #include #include @@ -693,7 +693,7 @@ inline void eval_trunc(T& result, const T& a) int c = eval_fpclassify(a); if(c == FP_NAN || c == FP_INFINITE) { - result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, mp_number(a), 0, boost::math::policies::policy<>()).backend(); + result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number(a), 0, boost::math::policies::policy<>()).backend(); return; } if(eval_get_sign(a) < 0) @@ -710,7 +710,7 @@ inline void eval_round(T& result, const T& a) int c = eval_fpclassify(a); if(c == FP_NAN || c == FP_INFINITE) { - result = boost::math::policies::raise_rounding_error("boost::multiprecision::round<%1%>(%1%)", 0, mp_number(a), 0, boost::math::policies::policy<>()).backend(); + result = boost::math::policies::raise_rounding_error("boost::multiprecision::round<%1%>(%1%)", 0, number(a), 0, boost::math::policies::policy<>()).backend(); return; } if(eval_get_sign(a) < 0) @@ -844,60 +844,60 @@ namespace math{ // Default versions of floating point classification routines: // template -inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::mp_number& arg) +inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { using multiprecision::default_ops::eval_fpclassify; return eval_fpclassify(arg.backend()); } template -inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::mp_exp& arg) +inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { - typedef typename multiprecision::detail::mp_exp::result_type value_type; + typedef typename multiprecision::detail::expression::result_type value_type; return fpclassify(value_type(arg)); } template -inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::mp_number& arg) +inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { int v = fpclassify(arg); return (v != FP_INFINITE) && (v != FP_NAN); } template -inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::mp_exp& arg) +inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { - typedef typename multiprecision::detail::mp_exp::result_type value_type; + typedef typename multiprecision::detail::expression::result_type value_type; return isfinite(value_type(arg)); } template -inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::mp_number& arg) +inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { return fpclassify(arg) == FP_NAN; } template -inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::mp_exp& arg) +inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { - typedef typename multiprecision::detail::mp_exp::result_type value_type; + typedef typename multiprecision::detail::expression::result_type value_type; return isnan(value_type(arg)); } template -inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::mp_number& arg) +inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { return fpclassify(arg) == FP_INFINITE; } template -inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::mp_exp& arg) +inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { - typedef typename multiprecision::detail::mp_exp::result_type value_type; + typedef typename multiprecision::detail::expression::result_type value_type; return isinf(value_type(arg)); } template -inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::mp_number& arg) +inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { return fpclassify(arg) == FP_NORMAL; } template -inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::mp_exp& arg) +inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { - typedef typename multiprecision::detail::mp_exp::result_type value_type; + typedef typename multiprecision::detail::expression::result_type value_type; return isnormal(value_type(arg)); } @@ -905,198 +905,198 @@ inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::deta namespace multiprecision{ template -inline typename detail::mp_exp::result_type trunc(const detail::mp_exp& v, const Policy& pol) +inline typename detail::expression::result_type trunc(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; return BOOST_MP_MOVE(trunc(number_type(v), pol)); } template -inline mp_number trunc(const mp_number& v, const Policy&) +inline number trunc(const number& v, const Policy&) { using default_ops::eval_trunc; - mp_number result; + number result; eval_trunc(result.backend(), v.backend()); return BOOST_MP_MOVE(result); } template -inline int itrunc(const detail::mp_exp& v, const Policy& pol) +inline int itrunc(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; number_type r = trunc(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, number_type(v), 0, pol).template convert_to(); return r.template convert_to(); } template -inline int itrunc(const detail::mp_exp& v) +inline int itrunc(const detail::expression& v) { return itrunc(v, boost::math::policies::policy<>()); } template -inline int itrunc(const mp_number& v, const Policy& pol) +inline int itrunc(const number& v, const Policy& pol) { - mp_number r = trunc(v, pol); + number r = trunc(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, v, 0, pol).template convert_to(); return r.template convert_to(); } template -inline int itrunc(const mp_number& v) +inline int itrunc(const number& v) { return itrunc(v, boost::math::policies::policy<>()); } template -inline long ltrunc(const detail::mp_exp& v, const Policy& pol) +inline long ltrunc(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; number_type r = trunc(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, number_type(v), 0L, pol).template convert_to(); return r.template convert_to(); } template -inline long ltrunc(const detail::mp_exp& v) +inline long ltrunc(const detail::expression& v) { return ltrunc(v, boost::math::policies::policy<>()); } template -inline long ltrunc(const mp_number& v, const Policy& pol) +inline long ltrunc(const number& v, const Policy& pol) { - mp_number r = trunc(v, pol); + number r = trunc(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, v, 0L, pol).template convert_to(); return r.template convert_to(); } template -inline long ltrunc(const mp_number& v) +inline long ltrunc(const number& v) { return ltrunc(v, boost::math::policies::policy<>()); } #ifndef BOOST_NO_LONG_LONG template -inline long long lltrunc(const detail::mp_exp& v, const Policy& pol) +inline long long lltrunc(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; number_type r = trunc(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, number_type(v), 0LL, pol).template convert_to(); return r.template convert_to(); } template -inline long long lltrunc(const detail::mp_exp& v) +inline long long lltrunc(const detail::expression& v) { return lltrunc(v, boost::math::policies::policy<>()); } template -inline long long lltrunc(const mp_number& v, const Policy& pol) +inline long long lltrunc(const number& v, const Policy& pol) { - mp_number r = trunc(v, pol); + number r = trunc(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, v, 0LL, pol).template convert_to(); return r.template convert_to(); } template -inline long long lltrunc(const mp_number& v) +inline long long lltrunc(const number& v) { return lltrunc(v, boost::math::policies::policy<>()); } #endif template -inline typename detail::mp_exp::result_type round(const detail::mp_exp& v, const Policy& pol) +inline typename detail::expression::result_type round(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; return BOOST_MP_MOVE(round(static_cast(v), pol)); } template -inline mp_number round(const mp_number& v, const Policy&) +inline number round(const number& v, const Policy&) { using default_ops::eval_round; - mp_number result; + number result; eval_round(result.backend(), v.backend()); return BOOST_MP_MOVE(result); } template -inline int iround(const detail::mp_exp& v, const Policy& pol) +inline int iround(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; number_type r = round(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0, pol).template convert_to(); return r.template convert_to(); } template -inline int iround(const detail::mp_exp& v) +inline int iround(const detail::expression& v) { return iround(v, boost::math::policies::policy<>()); } template -inline int iround(const mp_number& v, const Policy& pol) +inline int iround(const number& v, const Policy& pol) { - mp_number r = round(v, pol); + number r = round(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0, pol).template convert_to(); return r.template convert_to(); } template -inline int iround(const mp_number& v) +inline int iround(const number& v) { return iround(v, boost::math::policies::policy<>()); } template -inline long lround(const detail::mp_exp& v, const Policy& pol) +inline long lround(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; number_type r = round(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, number_type(v), 0L, pol).template convert_to(); return r.template convert_to(); } template -inline long lround(const detail::mp_exp& v) +inline long lround(const detail::expression& v) { return lround(v, boost::math::policies::policy<>()); } template -inline long lround(const mp_number& v, const Policy& pol) +inline long lround(const number& v, const Policy& pol) { - mp_number r = round(v, pol); + number r = round(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, v, 0L, pol).template convert_to(); return r.template convert_to(); } template -inline long lround(const mp_number& v) +inline long lround(const number& v) { return lround(v, boost::math::policies::policy<>()); } #ifndef BOOST_NO_LONG_LONG template -inline long long llround(const detail::mp_exp& v, const Policy& pol) +inline long long llround(const detail::expression& v, const Policy& pol) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; number_type r = round(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0LL, pol).template convert_to(); return r.template convert_to(); } template -inline long long llround(const detail::mp_exp& v) +inline long long llround(const detail::expression& v) { return llround(v, boost::math::policies::policy<>()); } template -inline long long llround(const mp_number& v, const Policy& pol) +inline long long llround(const number& v, const Policy& pol) { - mp_number r = round(v, pol); + number r = round(v, pol); if((r > (std::numeric_limits::max)()) || r < (std::numeric_limits::min)() || !boost::math::isfinite(v)) return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0LL, pol).template convert_to(); return r.template convert_to(); } template -inline long long llround(const mp_number& v) +inline long long llround(const number& v) { return llround(v, boost::math::policies::policy<>()); } @@ -1117,36 +1117,36 @@ struct BOOST_JOIN(func, _funct)\ }\ \ template \ -inline typename enable_if_c >::value == category,\ - detail::mp_exp<\ +inline typename enable_if_c >::value == category,\ + detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp > \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression > \ >::type \ -func(const detail::mp_exp& arg)\ +func(const detail::expression& arg)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ > (\ - detail::BOOST_JOIN(func, _funct) >::type>() \ + detail::BOOST_JOIN(func, _funct) >::type>() \ , arg \ );\ }\ template \ inline typename enable_if_c::value == category,\ - detail::mp_exp<\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number > \ + , number > \ >::type \ -func(const mp_number& arg)\ +func(const number& arg)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ + , number \ >(\ detail::BOOST_JOIN(func, _funct)() \ , arg \ @@ -1155,10 +1155,10 @@ func(const mp_number& arg)\ template \ inline typename boost::enable_if_c<\ boost::multiprecision::number_category::value == category,\ - mp_number >::type \ -func(const mp_number& arg)\ + number >::type \ +func(const number& arg)\ {\ - mp_number result;\ + number result;\ using default_ops::BOOST_JOIN(eval_,func);\ BOOST_JOIN(eval_,func)(result.backend(), arg.backend());\ return BOOST_MP_MOVE(result);\ @@ -1191,19 +1191,19 @@ struct BOOST_JOIN(func, _funct)\ }\ template \ inline typename enable_if_c::value == category,\ - detail::mp_exp<\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ - , mp_number > \ + , number \ + , number > \ >::type \ -func(const mp_number& arg, const mp_number& a)\ +func(const number& arg, const number& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ - , mp_number \ + , number \ + , number \ >(\ detail::BOOST_JOIN(func, _funct)() \ , arg,\ @@ -1212,20 +1212,20 @@ func(const mp_number& arg, const mp_number& a)\ }\ template \ inline typename enable_if_c<\ - (number_category::value == category) && (number_category >::value == category),\ - detail::mp_exp<\ + (number_category::value == category) && (number_category >::value == category),\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ - , detail::mp_exp > \ + , number \ + , detail::expression > \ >::type \ -func(const mp_number& arg, const detail::mp_exp& a)\ +func(const number& arg, const detail::expression& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ - , detail::mp_exp \ + , number \ + , detail::expression \ >(\ detail::BOOST_JOIN(func, _funct)() \ , arg,\ @@ -1234,20 +1234,20 @@ func(const mp_number& arg, const detail::mp_exp \ inline typename enable_if_c<\ - (number_category::value == category) && (number_category >::value == category),\ - detail::mp_exp<\ + (number_category::value == category) && (number_category >::value == category),\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , detail::mp_exp \ - , mp_number > \ + , detail::expression \ + , number > \ >::type \ -func(const detail::mp_exp& arg, const mp_number& a)\ +func(const detail::expression& arg, const number& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , detail::mp_exp \ - , mp_number \ + , detail::expression \ + , number \ >(\ detail::BOOST_JOIN(func, _funct)() \ , arg,\ @@ -1256,22 +1256,22 @@ func(const detail::mp_exp& arg, const mp_number \ inline typename enable_if_c<\ - (number_category >::value == category) && (number_category >::value == category),\ - detail::mp_exp<\ + (number_category >::value == category) && (number_category >::value == category),\ + detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ - , detail::mp_exp > \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ + , detail::expression > \ >::type \ -func(const detail::mp_exp& arg, const detail::mp_exp& a)\ +func(const detail::expression& arg, const detail::expression& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ - , detail::mp_exp \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ + , detail::expression \ >(\ - detail::BOOST_JOIN(func, _funct) >::type>() \ + detail::BOOST_JOIN(func, _funct) >::type>() \ , arg,\ a\ );\ @@ -1279,19 +1279,19 @@ func(const detail::mp_exp& arg, const detail::mp_exp \ inline typename enable_if_c<\ is_arithmetic::value && (number_category::value == category),\ - detail::mp_exp<\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ + , number \ , Arithmetic\ > \ >::type \ -func(const mp_number& arg, const Arithmetic& a)\ +func(const number& arg, const Arithmetic& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ + , number \ , Arithmetic\ >(\ detail::BOOST_JOIN(func, _funct)() \ @@ -1301,23 +1301,23 @@ func(const mp_number& arg, const Arithmetic& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category >::value == category),\ - detail::mp_exp<\ + is_arithmetic::value && (number_category >::value == category),\ + detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ , Arithmetic\ > \ >::type \ -func(const detail::mp_exp& arg, const Arithmetic& a)\ +func(const detail::expression& arg, const Arithmetic& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ , Arithmetic\ >(\ - detail::BOOST_JOIN(func, _funct) >::type>() \ + detail::BOOST_JOIN(func, _funct) >::type>() \ , arg,\ a\ );\ @@ -1325,20 +1325,20 @@ func(const detail::mp_exp& arg, const Arithmetic& a)\ template \ inline typename enable_if_c<\ is_arithmetic::value && (number_category::value == category),\ - detail::mp_exp<\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ , Arithmetic \ - , mp_number \ + , number \ > \ >::type \ -func(const Arithmetic& arg, const mp_number& a)\ +func(const Arithmetic& arg, const number& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ , Arithmetic \ - , mp_number \ + , number \ >(\ detail::BOOST_JOIN(func, _funct)() \ , arg,\ @@ -1347,33 +1347,33 @@ func(const Arithmetic& arg, const mp_number& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category >::value == category),\ - detail::mp_exp<\ + is_arithmetic::value && (number_category >::value == category),\ + detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::BOOST_JOIN(func, _funct) >::type> \ , Arithmetic \ - , detail::mp_exp \ + , detail::expression \ > \ >::type \ -func(const Arithmetic& arg, const detail::mp_exp& a)\ +func(const Arithmetic& arg, const detail::expression& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::BOOST_JOIN(func, _funct) >::type> \ , Arithmetic \ - , detail::mp_exp \ + , detail::expression \ >(\ - detail::BOOST_JOIN(func, _funct) >::type>() \ + detail::BOOST_JOIN(func, _funct) >::type>() \ , arg,\ a\ );\ }\ template \ inline typename enable_if_c<(number_category::value == category),\ - mp_number >::type \ -func(const mp_number& arg, const mp_number& a)\ + number >::type \ +func(const number& arg, const number& a)\ {\ - mp_number result;\ + number result;\ using default_ops:: BOOST_JOIN(eval_,func);\ BOOST_JOIN(eval_,func)(result.backend(), arg.backend(), a.backend());\ return BOOST_MP_MOVE(result);\ @@ -1381,12 +1381,12 @@ func(const mp_number& arg, const mp_number& a)\ template \ inline typename enable_if_c<\ is_arithmetic::value && (number_category::value == category),\ - mp_number \ + number \ >::type \ -func(const mp_number& arg, const Arithmetic& a)\ +func(const number& arg, const Arithmetic& a)\ {\ typedef typename detail::canonical::type canonical_type;\ - mp_number result;\ + number result;\ using default_ops:: BOOST_JOIN(eval_,func);\ BOOST_JOIN(eval_,func)(result.backend(), arg.backend(), static_cast(a));\ return BOOST_MP_MOVE(result);\ @@ -1394,12 +1394,12 @@ func(const mp_number& arg, const Arithmetic& a)\ template \ inline typename enable_if_c<\ is_arithmetic::value && (number_category::value == category),\ - mp_number \ + number \ >::type \ -func(const Arithmetic& a, const mp_number& arg)\ +func(const Arithmetic& a, const number& arg)\ {\ typedef typename detail::canonical::type canonical_type;\ - mp_number result;\ + number result;\ using default_ops:: BOOST_JOIN(eval_,func);\ BOOST_JOIN(eval_,func)(result.backend(), static_cast(a), arg.backend());\ return BOOST_MP_MOVE(result);\ @@ -1409,40 +1409,40 @@ func(const Arithmetic& a, const mp_number& arg)\ #define HETERO_BINARY_OP_FUNCTOR_B(func, Arg2, category)\ template \ inline typename enable_if_c<\ - (number_category >::value == category),\ - detail::mp_exp<\ + (number_category >::value == category),\ + detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ , Arg2> \ >::type \ -func(const detail::mp_exp& arg, Arg2 const& a)\ +func(const detail::expression& arg, Arg2 const& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ - , detail::BOOST_JOIN(func, _funct) >::type> \ - , detail::mp_exp \ + , detail::BOOST_JOIN(func, _funct) >::type> \ + , detail::expression \ , Arg2\ >(\ - detail::BOOST_JOIN(func, _funct) >::type>() \ + detail::BOOST_JOIN(func, _funct) >::type>() \ , arg, a \ );\ }\ template \ inline typename enable_if_c<\ (number_category::value == category),\ - detail::mp_exp<\ + detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ + , number \ , Arg2> \ >::type \ -func(const mp_number& arg, Arg2 const& a)\ +func(const number& arg, Arg2 const& a)\ {\ - return detail::mp_exp<\ + return detail::expression<\ detail::function\ , detail::BOOST_JOIN(func, _funct) \ - , mp_number \ + , number \ , Arg2\ >(\ detail::BOOST_JOIN(func, _funct)() \ @@ -1453,10 +1453,10 @@ func(const mp_number& arg, Arg2 const& a)\ template \ inline typename enable_if_c<\ (number_category::value == category),\ - mp_number >::type \ -func(const mp_number& arg, Arg2 const& a)\ + number >::type \ +func(const number& arg, Arg2 const& a)\ {\ - mp_number result;\ + number result;\ using default_ops:: BOOST_JOIN(eval_,func);\ BOOST_JOIN(eval_,func)(result.backend(), arg.backend(), a);\ return BOOST_MP_MOVE(result);\ @@ -1493,42 +1493,42 @@ struct abs_funct } template -inline detail::mp_exp< +inline detail::expression< detail::function - , detail::abs_funct >::type> - , detail::mp_exp > -abs(const detail::mp_exp& arg) + , detail::abs_funct >::type> + , detail::expression > +abs(const detail::expression& arg) { - return detail::mp_exp< + return detail::expression< detail::function - , detail::abs_funct >::type> - , detail::mp_exp + , detail::abs_funct >::type> + , detail::expression > ( - detail::abs_funct >::type>() + detail::abs_funct >::type>() , arg ); } template -inline detail::mp_exp< +inline detail::expression< detail::function , detail::abs_funct - , mp_number > -abs(const mp_number& arg) + , number > +abs(const number& arg) { - return detail::mp_exp< + return detail::expression< detail::function , detail::abs_funct - , mp_number + , number >( detail::abs_funct() , arg ); } template -inline mp_number -abs(const mp_number& arg) +inline number +abs(const number& arg) { - mp_number result; + number result; using default_ops::eval_abs; eval_abs(result.backend(), arg.backend()); return BOOST_MP_MOVE(result); @@ -1577,32 +1577,32 @@ HETERO_BINARY_OP_FUNCTOR_B(pow, unsigned, number_kind_integer) namespace math{ // -// Overload of Boost.Math functions that find the wrong overload when used with mp_number: +// Overload of Boost.Math functions that find the wrong overload when used with number: // namespace detail{ template T sinc_pi_imp(T); template T sinhc_pi_imp(T); } template -inline multiprecision::mp_number sinc_pi(const multiprecision::mp_number& x) +inline multiprecision::number sinc_pi(const multiprecision::number& x) { return BOOST_MP_MOVE(detail::sinc_pi_imp(x)); } template -inline multiprecision::mp_number sinc_pi(const multiprecision::mp_number& x, const Policy&) +inline multiprecision::number sinc_pi(const multiprecision::number& x, const Policy&) { return BOOST_MP_MOVE(detail::sinc_pi_imp(x)); } template -inline multiprecision::mp_number sinhc_pi(const multiprecision::mp_number& x) +inline multiprecision::number sinhc_pi(const multiprecision::number& x) { return BOOST_MP_MOVE(detail::sinhc_pi_imp(x)); } template -inline multiprecision::mp_number sinhc_pi(const multiprecision::mp_number& x, const Policy&) +inline multiprecision::number sinhc_pi(const multiprecision::number& x, const Policy&) { return BOOST_MP_MOVE(boost::math::sinhc_pi(x)); } diff --git a/include/boost/multiprecision/detail/functions/constants.hpp b/include/boost/multiprecision/detail/functions/constants.hpp index 4946ccf5..537b7bd1 100644 --- a/include/boost/multiprecision/detail/functions/constants.hpp +++ b/include/boost/multiprecision/detail/functions/constants.hpp @@ -246,7 +246,7 @@ const T& get_constant_ln2() static bool b = false; if(!b) { - calc_log2(result, boost::multiprecision::detail::digits2 >::value); + calc_log2(result, boost::multiprecision::detail::digits2 >::value); b = true; } @@ -262,7 +262,7 @@ const T& get_constant_e() static bool b = false; if(!b) { - calc_e(result, boost::multiprecision::detail::digits2 >::value); + calc_e(result, boost::multiprecision::detail::digits2 >::value); b = true; } @@ -278,7 +278,7 @@ const T& get_constant_pi() static bool b = false; if(!b) { - calc_pi(result, boost::multiprecision::detail::digits2 >::value); + calc_pi(result, boost::multiprecision::detail::digits2 >::value); b = true; } diff --git a/include/boost/multiprecision/detail/functions/pow.hpp b/include/boost/multiprecision/detail/functions/pow.hpp index dbae9aac..c0c2abc8 100644 --- a/include/boost/multiprecision/detail/functions/pow.hpp +++ b/include/boost/multiprecision/detail/functions/pow.hpp @@ -90,7 +90,7 @@ void hyp0F0(T& H0F0, const T& x) typedef typename mpl::front::type ui_type; BOOST_ASSERT(&H0F0 != &x); - long tol = boost::multiprecision::detail::digits2 >::value; + long tol = boost::multiprecision::detail::digits2 >::value; T t; T x_pow_n_div_n_fact(x); @@ -146,7 +146,7 @@ void hyp1F0(T& H1F0, const T& a, const T& x) eval_multiply(H1F0, pochham_a, x_pow_n_div_n_fact); eval_add(H1F0, si_type(1)); T lim; - eval_ldexp(lim, H1F0, 1 - boost::multiprecision::detail::digits2 >::value); + eval_ldexp(lim, H1F0, 1 - boost::multiprecision::detail::digits2 >::value); if(eval_get_sign(lim) < 0) lim.negate(); @@ -154,7 +154,7 @@ void hyp1F0(T& H1F0, const T& a, const T& x) T term, part; // Series expansion of hyperg_1f0(a; ; x). - for(n = 2; n < boost::multiprecision::detail::digits2 >::value + 10; n++) + for(n = 2; n < boost::multiprecision::detail::digits2 >::value + 10; n++) { eval_multiply(x_pow_n_div_n_fact, x); eval_divide(x_pow_n_div_n_fact, n); @@ -167,7 +167,7 @@ void hyp1F0(T& H1F0, const T& a, const T& x) if(lim.compare(term) >= 0) break; } - if(n >= boost::multiprecision::detail::digits2 >::value + 10) + if(n >= boost::multiprecision::detail::digits2 >::value + 10) BOOST_THROW_EXCEPTION(std::runtime_error("H1F0 failed to converge")); } @@ -193,7 +193,7 @@ void eval_exp(T& result, const T& x) bool isneg = eval_get_sign(x) < 0; if(type == FP_NAN) { - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; } else if(type == FP_INFINITE) @@ -218,7 +218,7 @@ void eval_exp(T& result, const T& x) xx.negate(); // Check the range of the argument. - static const canonical_exp_type maximum_arg_for_exp = std::numeric_limits >::max_exponent == 0 ? (std::numeric_limits::max)() : std::numeric_limits >::max_exponent; + static const canonical_exp_type maximum_arg_for_exp = std::numeric_limits >::max_exponent == 0 ? (std::numeric_limits::max)() : std::numeric_limits >::max_exponent; if(xx.compare(maximum_arg_for_exp) >= 0) { @@ -226,7 +226,7 @@ void eval_exp(T& result, const T& x) if(isneg) result = ui_type(0); else - result = std::numeric_limits >::has_infinity ? std::numeric_limits >::infinity().backend() : (std::numeric_limits >::max)().backend(); + result = std::numeric_limits >::has_infinity ? std::numeric_limits >::infinity().backend() : (std::numeric_limits >::max)().backend(); return; } if(xx.compare(si_type(1)) <= 0) @@ -234,7 +234,7 @@ void eval_exp(T& result, const T& x) // // Use series for exp(x) - 1: // - T lim = std::numeric_limits >::epsilon().backend(); + T lim = std::numeric_limits >::epsilon().backend(); unsigned k = 2; exp_series = xx; result = si_type(1); @@ -344,7 +344,7 @@ void eval_log(T& result, const T& arg) else eval_subtract(result, t); - eval_multiply(lim, result, std::numeric_limits >::epsilon().backend()); + eval_multiply(lim, result, std::numeric_limits >::epsilon().backend()); if(eval_get_sign(lim) < 0) lim.negate(); INSTRUMENT_BACKEND(lim); @@ -465,7 +465,7 @@ inline void eval_pow(T& result, const T& x, const T& a) if((eval_get_sign(x) < 0) && !bo_a_isint) { - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); } T t, da; @@ -564,7 +564,7 @@ namespace detail{ ui_type k = 1; T lim(x); - eval_ldexp(lim, lim, 1 - boost::multiprecision::detail::digits2 >::value); + eval_ldexp(lim, lim, 1 - boost::multiprecision::detail::digits2 >::value); do { diff --git a/include/boost/multiprecision/detail/functions/trig.hpp b/include/boost/multiprecision/detail/functions/trig.hpp index b60722f5..4e57b070 100644 --- a/include/boost/multiprecision/detail/functions/trig.hpp +++ b/include/boost/multiprecision/detail/functions/trig.hpp @@ -36,7 +36,7 @@ void hyp0F1(T& result, const T& b, const T& x) T tol; tol = ui_type(1); - eval_ldexp(tol, tol, 1 - boost::multiprecision::detail::digits2 >::value); + eval_ldexp(tol, tol, 1 - boost::multiprecision::detail::digits2 >::value); eval_multiply(tol, result); if(eval_get_sign(tol) < 0) tol.negate(); @@ -87,7 +87,7 @@ void eval_sin(T& result, const T& x) { case FP_INFINITE: case FP_NAN: - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; case FP_ZERO: result = ui_type(0); @@ -233,7 +233,7 @@ void eval_cos(T& result, const T& x) { case FP_INFINITE: case FP_NAN: - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; case FP_ZERO: result = ui_type(1); @@ -391,7 +391,7 @@ void hyp2F1(T& result, const T& a, const T& b, const T& c, const T& x) eval_add(result, ui_type(1)); T lim; - eval_ldexp(lim, result, 1 - boost::multiprecision::detail::digits2 >::value); + eval_ldexp(lim, result, 1 - boost::multiprecision::detail::digits2 >::value); if(eval_get_sign(lim) < 0) lim.negate(); @@ -447,7 +447,7 @@ void eval_asin(T& result, const T& x) { case FP_NAN: case FP_INFINITE: - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; case FP_ZERO: result = ui_type(0); @@ -464,7 +464,7 @@ void eval_asin(T& result, const T& x) int c = xx.compare(ui_type(1)); if(c > 0) { - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; } else if(c == 0) @@ -524,7 +524,7 @@ void eval_asin(T& result, const T& x) eval_subtract(result, s); T lim; - eval_ldexp(lim, result, 1 - boost::multiprecision::detail::digits2 >::value); + eval_ldexp(lim, result, 1 - boost::multiprecision::detail::digits2 >::value); if(eval_get_sign(s) < 0) s.negate(); if(eval_get_sign(lim) < 0) @@ -546,7 +546,7 @@ inline void eval_acos(T& result, const T& x) { case FP_NAN: case FP_INFINITE: - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; case FP_ZERO: result = get_constant_pi(); @@ -559,7 +559,7 @@ inline void eval_acos(T& result, const T& x) if(c > 0) { - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; } else if(c == 0) @@ -591,7 +591,7 @@ void eval_atan(T& result, const T& x) switch(eval_fpclassify(x)) { case FP_NAN: - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); return; case FP_ZERO: result = ui_type(0); @@ -656,7 +656,7 @@ void eval_atan(T& result, const T& x) static const boost::int32_t double_digits10_minus_a_few = std::numeric_limits::digits10 - 3; T s, c, t; - for(boost::int32_t digits = double_digits10_minus_a_few; digits <= std::numeric_limits >::digits10; digits *= 2) + for(boost::int32_t digits = double_digits10_minus_a_few; digits <= std::numeric_limits >::digits10; digits *= 2) { eval_sin(s, result); eval_cos(c, result); @@ -710,7 +710,7 @@ void eval_atan2(T& result, const T& y, const T& x) { if(eval_fpclassify(x) == FP_INFINITE) { - result = std::numeric_limits >::quiet_NaN().backend(); + result = std::numeric_limits >::quiet_NaN().backend(); } else { diff --git a/include/boost/multiprecision/detail/generic_interconvert.hpp b/include/boost/multiprecision/detail/generic_interconvert.hpp index adb1eea8..2cda6a6e 100644 --- a/include/boost/multiprecision/detail/generic_interconvert.hpp +++ b/include/boost/multiprecision/detail/generic_interconvert.hpp @@ -116,7 +116,7 @@ void generic_interconvert(To& to, const From& from, const mpl::int_ >::radix != 2) + if(std::numeric_limits >::radix != 2) { to = from.str(0, std::ios_base::fmtflags()).c_str(); return; @@ -190,10 +190,10 @@ void generic_interconvert(To& to, const From& from, const mpl::int_ void generic_interconvert(To& to, const From& from, const mpl::int_& /*to_type*/, const mpl::int_& /*from_type*/) { - typedef typename component_type >::type from_component_type; - typedef typename component_type >::type to_component_type; + typedef typename component_type >::type from_component_type; + typedef typename component_type >::type to_component_type; - mp_number t(from); + number t(from); to_component_type n(numerator(t)), d(denominator(t)); using default_ops::assign_components; assign_components(to, n.backend(), d.backend()); @@ -202,9 +202,9 @@ void generic_interconvert(To& to, const From& from, const mpl::int_ void generic_interconvert(To& to, const From& from, const mpl::int_& /*to_type*/, const mpl::int_& /*from_type*/) { - typedef typename component_type >::type to_component_type; + typedef typename component_type >::type to_component_type; - mp_number t(from); + number t(from); to_component_type n(t), d(1); using default_ops::assign_components; assign_components(to, n.backend(), d.backend()); @@ -213,12 +213,12 @@ void generic_interconvert(To& to, const From& from, const mpl::int_ void generic_interconvert(To& to, const From& from, const mpl::int_& /*to_type*/, const mpl::int_& /*from_type*/) { - typedef typename component_type >::type from_component_type; + typedef typename component_type >::type from_component_type; using default_ops::eval_divide; - mp_number t(from); + number t(from); from_component_type n(numerator(t)), d(denominator(t)); - mp_number fn(n), fd(d); + number fn(n), fd(d); eval_divide(to, fn.backend(), fd.backend()); } diff --git a/include/boost/multiprecision/detail/integer_ops.hpp b/include/boost/multiprecision/detail/integer_ops.hpp index ccdbbe8b..4103d81b 100644 --- a/include/boost/multiprecision/detail/integer_ops.hpp +++ b/include/boost/multiprecision/detail/integer_ops.hpp @@ -6,7 +6,7 @@ #ifndef BOOST_MP_INT_FUNC_HPP #define BOOST_MP_INT_FUNC_HPP -#include +#include namespace boost{ namespace multiprecision{ @@ -42,8 +42,8 @@ inline Integer eval_integer_modulus(const Backend& x, Integer val) template inline typename enable_if_c::value == number_kind_integer>::type - divide_qr(const mp_number& x, const mp_number& y, - mp_number& q, mp_number& r) + divide_qr(const number& x, const number& y, + number& q, number& r) { using default_ops::eval_qr; eval_qr(x.backend(), y.backend(), q.backend(), r.backend()); @@ -51,57 +51,57 @@ inline typename enable_if_c::value == number_kind_integ template inline typename enable_if_c::value == number_kind_integer>::type - divide_qr(const mp_number& x, const multiprecision::detail::mp_exp& y, - mp_number& q, mp_number& r) + divide_qr(const number& x, const multiprecision::detail::expression& y, + number& q, number& r) { - divide_qr(x, mp_number(y), q, r); + divide_qr(x, number(y), q, r); } template inline typename enable_if_c::value == number_kind_integer>::type - divide_qr(const multiprecision::detail::mp_exp& x, const mp_number& y, - mp_number& q, mp_number& r) + divide_qr(const multiprecision::detail::expression& x, const number& y, + number& q, number& r) { - divide_qr(mp_number(x), y, q, r); + divide_qr(number(x), y, q, r); } template inline typename enable_if_c::value == number_kind_integer>::type - divide_qr(const multiprecision::detail::mp_exp& x, const multiprecision::detail::mp_exp& y, - mp_number& q, mp_number& r) + divide_qr(const multiprecision::detail::expression& x, const multiprecision::detail::expression& y, + number& q, number& r) { - divide_qr(mp_number(x), mp_number(y), q, r); + divide_qr(number(x), number(y), q, r); } template inline typename enable_if, mpl::bool_::value == number_kind_integer> >, Integer>::type - integer_modulus(const mp_number& x, Integer val) + integer_modulus(const number& x, Integer val) { using default_ops::eval_integer_modulus; return eval_integer_modulus(x.backend(), val); } template -inline typename enable_if, mpl::bool_::result_type>::value == number_kind_integer> >, Integer>::type - integer_modulus(const multiprecision::detail::mp_exp& x, Integer val) +inline typename enable_if, mpl::bool_::result_type>::value == number_kind_integer> >, Integer>::type + integer_modulus(const multiprecision::detail::expression& x, Integer val) { - typedef typename multiprecision::detail::mp_exp::result_type result_type; + typedef typename multiprecision::detail::expression::result_type result_type; return integer_modulus(result_type(x), val); } template inline typename enable_if_c::value == number_kind_integer, unsigned>::type - lsb(const mp_number& x) + lsb(const number& x) { using default_ops::eval_lsb; return eval_lsb(x.backend()); } template -inline typename enable_if_c::result_type>::value == number_kind_integer, unsigned>::type - lsb(const multiprecision::detail::mp_exp& x) +inline typename enable_if_c::result_type>::value == number_kind_integer, unsigned>::type + lsb(const multiprecision::detail::expression& x) { - typedef typename multiprecision::detail::mp_exp::result_type number_type; + typedef typename multiprecision::detail::expression::result_type number_type; number_type n(x); using default_ops::eval_lsb; return eval_lsb(n.backend()); @@ -109,25 +109,25 @@ inline typename enable_if_c inline typename enable_if_c::value == number_kind_integer, bool>::type - bit_test(const mp_number& x, unsigned index) + bit_test(const number& x, unsigned index) { using default_ops::eval_bit_test; return eval_bit_test(x.backend(), index); } template -inline typename enable_if_c::result_type>::value == number_kind_integer, bool>::type - bit_test(const multiprecision::detail::mp_exp& x, unsigned index) +inline typename enable_if_c::result_type>::value == number_kind_integer, bool>::type + bit_test(const multiprecision::detail::expression& x, unsigned index) { - typedef typename multiprecision::detail::mp_exp::result_type number_type; + typedef typename multiprecision::detail::expression::result_type number_type; number_type n(x); using default_ops::eval_bit_test; return eval_bit_test(n.backend(), index); } template -inline typename enable_if_c::value == number_kind_integer, mp_number&>::type - bit_set(mp_number& x, unsigned index) +inline typename enable_if_c::value == number_kind_integer, number&>::type + bit_set(number& x, unsigned index) { using default_ops::eval_bit_set; eval_bit_set(x.backend(), index); @@ -135,8 +135,8 @@ inline typename enable_if_c::value == number_kind_integ } template -inline typename enable_if_c::value == number_kind_integer, mp_number&>::type - bit_unset(mp_number& x, unsigned index) +inline typename enable_if_c::value == number_kind_integer, number&>::type + bit_unset(number& x, unsigned index) { using default_ops::eval_bit_unset; eval_bit_unset(x.backend(), index); @@ -144,8 +144,8 @@ inline typename enable_if_c::value == number_kind_integ } template -inline typename enable_if_c::value == number_kind_integer, mp_number&>::type - bit_flip(mp_number& x, unsigned index) +inline typename enable_if_c::value == number_kind_integer, number&>::type + bit_flip(number& x, unsigned index) { using default_ops::eval_bit_flip; eval_bit_flip(x.backend(), index); @@ -314,10 +314,10 @@ inline typename enable_if< is_integral > >, - detail::mp_exp >::type + detail::expression >::type powm(const T& b, const U& p, const V& mod) { - return detail::mp_exp( + return detail::expression( detail::powm_func(), b, p, mod); } diff --git a/include/boost/multiprecision/detail/mp_number_base.hpp b/include/boost/multiprecision/detail/mp_number_base.hpp deleted file mode 100644 index 2d3e0b89..00000000 --- a/include/boost/multiprecision/detail/mp_number_base.hpp +++ /dev/null @@ -1,1262 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright 2011 John Maddock. Distributed under the Boost -// Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_MATH_BIG_NUM_BASE_HPP -#define BOOST_MATH_BIG_NUM_BASE_HPP - -#include -#include -#include -#include - -namespace boost{ namespace multiprecision{ - -template -class mp_number; - -template -struct is_mp_number : public mpl::false_ {}; - -template -struct is_mp_number > : public mpl::true_ {}; - -namespace detail{ - -// Forward-declare an expression wrapper -template -struct mp_exp; - -} // namespace detail - -template -struct is_mp_number_expression : public mpl::false_ {}; - -template -struct is_mp_number_expression > : public mpl::true_ {}; - -namespace detail{ -// -// Workaround for missing abs(long long) on some compilers: -// -template -typename boost::enable_if, T>::type abs(const T& t) BOOST_NOEXCEPT -{ - return t < 0 ? -t : t; -} - -#define BOOST_MP_USING_ABS using std::abs; using boost::multiprecision::detail::abs; - -// -// Move support: -// -#ifndef BOOST_NO_RVALUE_REFERENCES -# define BOOST_MP_MOVE(x) std::move(x) -#else -# define BOOST_MP_MOVE(x) x -#endif - -template -struct has_enough_bits -{ - template - struct type : public mpl::bool_::digits >= b>{}; -}; - -template -struct canonical_imp -{ - typedef Val type; -}; -template -struct canonical_imp > -{ - typedef typename has_enough_bits::digits>::template type pred_type; - typedef typename mpl::find_if< - typename Backend::signed_types, - pred_type - >::type iter_type; - typedef typename mpl::deref::type type; -}; -template -struct canonical_imp > -{ - typedef typename has_enough_bits::digits>::template type pred_type; - typedef typename mpl::find_if< - typename Backend::unsigned_types, - pred_type - >::type iter_type; - typedef typename mpl::deref::type type; -}; -template -struct canonical_imp > -{ - typedef typename has_enough_bits::digits>::template type pred_type; - typedef typename mpl::find_if< - typename Backend::float_types, - pred_type - >::type iter_type; - typedef typename mpl::deref::type type; -}; -template -struct canonical_imp > -{ - typedef const char* type; -}; - -template -struct canonical -{ - typedef typename mpl::if_< - is_signed, - mpl::int_<0>, - typename mpl::if_< - is_unsigned, - mpl::int_<1>, - typename mpl::if_< - is_floating_point, - mpl::int_<2>, - typename mpl::if_< - mpl::or_< - is_convertible, - is_same - >, - mpl::int_<3>, - mpl::int_<4> - >::type - >::type - >::type - >::type tag_type; - - typedef typename canonical_imp::type type; -}; - -struct terminal{}; -struct negate{}; -struct plus{}; -struct minus{}; -struct multiplies{}; -struct divides{}; -struct modulus{}; -struct shift_left{}; -struct shift_right{}; -struct bitwise_and{}; -struct bitwise_or{}; -struct bitwise_xor{}; -struct bitwise_complement{}; -struct add_immediates{}; -struct subtract_immediates{}; -struct multiply_immediates{}; -struct divide_immediates{}; -struct modulus_immediates{}; -struct bitwise_and_immediates{}; -struct bitwise_or_immediates{}; -struct bitwise_xor_immediates{}; -struct complement_immediates{}; -struct function{}; - -template -struct backend_type; - -template -struct backend_type > -{ - typedef T type; -}; - -template -struct backend_type > -{ - typedef typename backend_type::result_type>::type type; -}; - - -template -struct is_mp_number : public mpl::false_{}; -template -struct is_mp_number > : public mpl::true_{}; -template -struct is_mp_number_exp : public mpl::false_{}; -template -struct is_mp_number_exp > : public mpl::true_{}; - -template -struct combine_expression; - -template -struct combine_expression, T2> -{ - typedef mp_number type; -}; - -template -struct combine_expression > -{ - typedef mp_number type; -}; - -template -struct combine_expression, mp_number > -{ - typedef mp_number type; -}; - -template -struct arg_type -{ - typedef mp_exp type; -}; - -template -struct arg_type > -{ - typedef mp_exp type; -}; - -template -struct unmentionable -{ - static void proc(){} -}; - -typedef void (*unmentionable_type)(); - -template -struct mp_exp_storage -{ - typedef const T& type; -}; - -template -struct mp_exp_storage -{ - typedef T* type; -}; - -template -struct mp_exp_storage -{ - typedef const T* type; -}; - -template -struct mp_exp_storage > -{ - typedef mp_exp type; -}; - -template -struct mp_exp -{ - typedef mpl::int_<1> arity; - typedef typename arg_type::type left_type; - typedef typename left_type::result_type result_type; - typedef tag tag_type; - - explicit mp_exp(const Arg1& a) : arg(a) {} - - left_type left()const { return left_type(arg); } - - const Arg1& left_ref()const BOOST_NOEXCEPT { return arg; } - - static const unsigned depth = left_type::depth + 1; - - operator unmentionable_type()const - { - result_type r(*this); - return r ? &unmentionable::proc : 0; - } - -private: - typename mp_exp_storage::type arg; - mp_exp& operator=(const mp_exp&); -}; - -template -struct mp_exp -{ - typedef mpl::int_<0> arity; - typedef Arg1 result_type; - typedef terminal tag_type; - - explicit mp_exp(const Arg1& a) : arg(a) {} - - const Arg1& value()const BOOST_NOEXCEPT { return arg; } - - static const unsigned depth = 0; - - operator unmentionable_type()const - { - return arg ? &unmentionable::proc : 0; - } - -private: - typename mp_exp_storage::type arg; - mp_exp& operator=(const mp_exp&); -}; - -template -struct mp_exp -{ - typedef mpl::int_<2> arity; - typedef typename arg_type::type left_type; - typedef typename arg_type::type right_type; - typedef typename left_type::result_type left_result_type; - typedef typename right_type::result_type right_result_type; - typedef typename combine_expression::type result_type; - typedef tag tag_type; - - mp_exp(const Arg1& a1, const Arg2& a2) : arg1(a1), arg2(a2) {} - - left_type left()const { return left_type(arg1); } - right_type right()const { return right_type(arg2); } - const Arg1& left_ref()const BOOST_NOEXCEPT { return arg1; } - const Arg2& right_ref()const BOOST_NOEXCEPT { return arg2; } - - operator unmentionable_type()const - { - result_type r(*this); - return r ? &unmentionable::proc : 0; - } - - static const unsigned left_depth = left_type::depth + 1; - static const unsigned right_depth = right_type::depth + 1; - static const unsigned depth = left_depth > right_depth ? left_depth : right_depth; -private: - typename mp_exp_storage::type arg1; - typename mp_exp_storage::type arg2; - mp_exp& operator=(const mp_exp&); -}; - -template -struct mp_exp -{ - typedef mpl::int_<3> arity; - typedef typename arg_type::type left_type; - typedef typename arg_type::type middle_type; - typedef typename arg_type::type right_type; - typedef typename left_type::result_type left_result_type; - typedef typename middle_type::result_type middle_result_type; - typedef typename right_type::result_type right_result_type; - typedef typename combine_expression< - left_result_type, - typename combine_expression::type - >::type result_type; - typedef tag tag_type; - - mp_exp(const Arg1& a1, const Arg2& a2, const Arg3& a3) : arg1(a1), arg2(a2), arg3(a3) {} - - left_type left()const { return left_type(arg1); } - middle_type middle()const { return middle_type(arg2); } - right_type right()const { return right_type(arg3); } - const Arg1& left_ref()const BOOST_NOEXCEPT { return arg1; } - const Arg2& middle_ref()const BOOST_NOEXCEPT { return arg2; } - const Arg3& right_ref()const BOOST_NOEXCEPT { return arg3; } - - operator unmentionable_type()const - { - result_type r(*this); - return r ? &unmentionable::proc : 0; - } - - static const unsigned left_depth = left_type::depth + 1; - static const unsigned middle_depth = middle_type::depth + 1; - static const unsigned right_depth = right_type::depth + 1; - static const unsigned depth = left_depth > right_depth ? (left_depth > middle_depth ? left_depth : middle_depth) : (right_depth > middle_depth ? right_depth : middle_depth); -private: - typename mp_exp_storage::type arg1; - typename mp_exp_storage::type arg2; - typename mp_exp_storage::type arg3; - mp_exp& operator=(const mp_exp&); -}; - -template -struct mp_exp -{ - typedef mpl::int_<4> arity; - typedef typename arg_type::type left_type; - typedef typename arg_type::type left_middle_type; - typedef typename arg_type::type right_middle_type; - typedef typename arg_type::type right_type; - typedef typename left_type::result_type left_result_type; - typedef typename left_middle_type::result_type left_middle_result_type; - typedef typename right_middle_type::result_type right_middle_result_type; - typedef typename right_type::result_type right_result_type; - typedef typename combine_expression< - typename combine_expression< - typename combine_expression::type, - right_middle_result_type - >::type, - right_result_type - >::type result_type; - typedef tag tag_type; - - mp_exp(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4) : arg1(a1), arg2(a2), arg3(a3), arg4(a4) {} - - left_type left()const { return left_type(arg1); } - left_middle_type left_middle()const { return left_middle_type(arg2); } - right_middle_type right_middle()const { return right_middle_type(arg3); } - right_type right()const { return right_type(arg4); } - const Arg1& left_ref()const BOOST_NOEXCEPT { return arg1; } - const Arg2& left_middle_ref()const BOOST_NOEXCEPT { return arg2; } - const Arg3& right_middle_ref()const BOOST_NOEXCEPT { return arg3; } - const Arg4& right_ref()const BOOST_NOEXCEPT { return arg4; } - - operator unmentionable_type()const - { - result_type r(*this); - return r ? &unmentionable::proc : 0; - } - - static const unsigned left_depth = left_type::depth + 1; - static const unsigned left_middle_depth = left_middle_type::depth + 1; - static const unsigned right_middle_depth = right_middle_type::depth + 1; - static const unsigned right_depth = right_type::depth + 1; - - static const unsigned left_max_depth = left_depth > left_middle_depth ? left_depth : left_middle_depth; - static const unsigned right_max_depth = right_depth > right_middle_depth ? right_depth : right_middle_depth; - - static const unsigned depth = left_max_depth > right_max_depth ? left_max_depth : right_max_depth; -private: - typename mp_exp_storage::type arg1; - typename mp_exp_storage::type arg2; - typename mp_exp_storage::type arg3; - typename mp_exp_storage::type arg4; - mp_exp& operator=(const mp_exp&); -}; - -template -struct digits2 -{ - BOOST_STATIC_ASSERT(std::numeric_limits::is_specialized); - BOOST_STATIC_ASSERT((std::numeric_limits::radix == 2) || (std::numeric_limits::radix == 10)); - // If we really have so many digits that this fails, then we're probably going to hit other problems anyway: - BOOST_STATIC_ASSERT(LONG_MAX / 1000 > (std::numeric_limits::digits + 1)); - static const long value = std::numeric_limits::radix == 10 ? (((std::numeric_limits::digits + 1) * 1000L) / 301L) : std::numeric_limits::digits; -}; - -#ifndef BOOST_MP_MIN_EXPONENT_DIGITS -#ifdef _MSC_VER -# define BOOST_MP_MIN_EXPONENT_DIGITS 2 -#else -# define BOOST_MP_MIN_EXPONENT_DIGITS 2 -#endif -#endif - -template -void format_float_string(S& str, boost::intmax_t my_exp, boost::intmax_t digits, std::ios_base::fmtflags f, bool iszero) -{ - typedef typename S::size_type size_type; - bool scientific = (f & std::ios_base::scientific) == std::ios_base::scientific; - bool fixed = (f & std::ios_base::fixed) == std::ios_base::fixed; - bool showpoint = (f & std::ios_base::showpoint) == std::ios_base::showpoint; - bool showpos = (f & std::ios_base::showpos) == std::ios_base::showpos; - - bool neg = str.size() && (str[0] == '-'); - - if(neg) - str.erase(0, 1); - - if(digits == 0) - { - digits = (std::max)(str.size(), size_type(16)); - } - - if(iszero || str.empty() || (str.find_first_not_of('0') == S::npos)) - { - // We will be printing zero, even though the value might not - // actually be zero (it just may have been rounded to zero). - str = "0"; - if(scientific || fixed) - { - str.append(1, '.'); - str.append(size_type(digits), '0'); - if(scientific) - str.append("e+00"); - } - else - { - if(showpoint) - { - str.append(1, '.'); - if(digits > 1) - str.append(size_type(digits - 1), '0'); - } - } - if(neg) - str.insert(0, 1, '-'); - else if(showpos) - str.insert(0, 1, '+'); - return; - } - - if(!fixed && !scientific && !showpoint) - { - // - // Suppress trailing zeros: - // - std::string::iterator pos = str.end(); - while(pos != str.begin() && *--pos == '0'){} - if(pos != str.end()) - ++pos; - str.erase(pos, str.end()); - if(str.empty()) - str = '0'; - } - else if(!fixed || (my_exp >= 0)) - { - // - // Pad out the end with zero's if we need to: - // - boost::intmax_t chars = str.size(); - chars = digits - chars; - if(scientific) - ++chars; - if(chars > 0) - { - str.append(static_cast(chars), '0'); - } - } - - if(fixed || (!scientific && (my_exp >= -4) && (my_exp < digits))) - { - if(1 + my_exp > static_cast(str.size())) - { - // Just pad out the end with zeros: - str.append(static_cast(1 + my_exp - str.size()), '0'); - if(showpoint || fixed) - str.append("."); - } - else if(my_exp + 1 < static_cast(str.size())) - { - if(my_exp < 0) - { - str.insert(0, static_cast(-1 - my_exp), '0'); - str.insert(0, "0."); - } - else - { - // Insert the decimal point: - str.insert(static_cast(my_exp + 1), 1, '.'); - } - } - else if(showpoint || fixed) // we have exactly the digits we require to left of the point - str += "."; - - if(fixed) - { - // We may need to add trailing zeros: - boost::intmax_t l = str.find('.') + 1; - l = digits - (str.size() - l); - if(l > 0) - str.append(size_type(l), '0'); - } - } - else - { - BOOST_MP_USING_ABS - // Scientific format: - if(showpoint || (str.size() > 1)) - str.insert(1, 1, '.'); - str.append(1, 'e'); - S e = boost::lexical_cast(abs(my_exp)); - if(e.size() < BOOST_MP_MIN_EXPONENT_DIGITS) - e.insert(0, BOOST_MP_MIN_EXPONENT_DIGITS-e.size(), '0'); - if(my_exp < 0) - e.insert(0, 1, '-'); - else - e.insert(0, 1, '+'); - str.append(e); - } - if(neg) - str.insert(0, 1, '-'); - else if(showpos) - str.insert(0, 1, '+'); -} - -} // namespace detail - -// -// Non-member operators for mp_number: -// -// Unary operators first: -// -template -inline const mp_number& operator + (const mp_number& v) { return v; } -template -inline const detail::mp_exp& operator + (const detail::mp_exp& v) { return v; } -template -inline detail::mp_exp > operator - (const mp_number& v) { return detail::mp_exp >(v); } -template -inline detail::mp_exp > operator - (const detail::mp_exp& v) { return detail::mp_exp >(v); } -template -inline detail::mp_exp > operator ~ (const mp_number& v) { return detail::mp_exp >(v); } -template -inline detail::mp_exp > operator ~ (const detail::mp_exp& v) { return detail::mp_exp >(v); } -// -// Then addition: -// -template -inline detail::mp_exp, mp_number > - operator + (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator + (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator + (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator + (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator + (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator + (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator + (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator + (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: -// -template -inline detail::mp_exp, typename detail::mp_exp::left_type > - operator + (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type >(a, b.left_ref()); -} -template -inline detail::mp_exp, typename detail::mp_exp::left_type > - operator + (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type >(b, a.left_ref()); -} -template -inline detail::mp_exp, mp_number > - operator + (const mp_number& a, const detail::mp_exp >& b) -{ - return detail::mp_exp, mp_number >(a, b.left_ref()); -} -template -inline detail::mp_exp, mp_number > - operator + (const detail::mp_exp >& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(b, a.left_ref()); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator + (const detail::mp_exp >& a, const V& b) -{ - return detail::mp_exp >(b, a.left_ref()); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator + (const V& a, const detail::mp_exp >& b) -{ - return detail::mp_exp, mp_number >(a, b.left_ref()); -} -// -// Subtraction: -// -template -inline detail::mp_exp, mp_number > - operator - (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator - (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator - (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator - (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator - (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator - (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator - (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator - (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: -// -template -inline detail::mp_exp, typename detail::mp_exp::left_type > - operator - (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type >(a, b.left_ref()); -} -template -inline detail::mp_exp, typename detail::mp_exp::left_type > > - operator - (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type > >( - detail::mp_exp, typename detail::mp_exp::left_type >(b, a.left_ref())); -} -template -inline detail::mp_exp, mp_number > - operator - (const mp_number& a, const detail::mp_exp >& b) -{ - return detail::mp_exp, mp_number >(a, b.left_ref()); -} -template -inline detail::mp_exp, mp_number > > - operator - (const detail::mp_exp >& a, const mp_number& b) -{ - return detail::mp_exp, mp_number > >( - detail::mp_exp, mp_number >(b, a.left_ref())); -} -template -inline typename enable_if, detail::mp_exp, V > > >::type - operator - (const detail::mp_exp >& a, const V& b) -{ - return detail::mp_exp, V > >(detail::mp_exp, V >(a.left_ref(), b)); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator - (const V& a, const detail::mp_exp >& b) -{ - return detail::mp_exp >(a, b.left_ref()); -} -// -// Multiplication: -// -template -inline detail::mp_exp, mp_number > - operator * (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator * (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator * (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator * (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator * (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator * (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator * (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator * (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: -// -template -inline detail::mp_exp, typename detail::mp_exp::left_type > > - operator * (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type > >( - detail::mp_exp, typename detail::mp_exp::left_type > (a, b.left_ref())); -} -template -inline detail::mp_exp, typename detail::mp_exp::left_type > > - operator * (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type > >( - detail::mp_exp, typename detail::mp_exp::left_type >(b, a.left_ref())); -} -template -inline detail::mp_exp, mp_number > > - operator * (const mp_number& a, const detail::mp_exp >& b) -{ - return detail::mp_exp, mp_number > >( - detail::mp_exp, mp_number >(a, b.left_ref())); -} -template -inline detail::mp_exp, mp_number > > - operator * (const detail::mp_exp >& a, const mp_number& b) -{ - return detail::mp_exp, mp_number > >( - detail::mp_exp, mp_number >(b, a.left_ref())); -} -template -inline typename enable_if, detail::mp_exp, V > > >::type - operator * (const detail::mp_exp >& a, const V& b) -{ - return detail::mp_exp, V > > ( - detail::mp_exp, V >(a.left_ref(), b)); -} -template -inline typename enable_if, detail::mp_exp, V > > >::type - operator * (const V& a, const detail::mp_exp >& b) -{ - return detail::mp_exp, V > >( - detail::mp_exp, V >(b.left_ref(), a)); -} -// -// Division: -// -template -inline detail::mp_exp, mp_number > - operator / (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator / (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator / (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator / (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator / (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator / (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator / (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator / (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: -// -template -inline detail::mp_exp, typename detail::mp_exp::left_type > > - operator / (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, typename detail::mp_exp::left_type > >( - detail::mp_exp, typename detail::mp_exp::left_type >(a, b.left_ref())); -} -template -inline detail::mp_exp::left_type, mp_number > > - operator / (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp::left_type, mp_number > >( - detail::mp_exp::left_type, mp_number >(a.left_ref(), b)); -} -template -inline detail::mp_exp, mp_number > > - operator / (const mp_number& a, const detail::mp_exp >& b) -{ - return detail::mp_exp, mp_number > >( - detail::mp_exp, mp_number >(a, b.left_ref())); -} -template -inline detail::mp_exp, mp_number > > - operator / (const detail::mp_exp >& a, const mp_number& b) -{ - return detail::mp_exp, mp_number > >( - detail::mp_exp, mp_number >(a.left_ref(), b)); -} -template -inline typename enable_if, detail::mp_exp, V > > >::type - operator / (const detail::mp_exp >& a, const V& b) -{ - return detail::mp_exp, V > >( - detail::mp_exp, V>(a.left_ref(), b)); -} -template -inline typename enable_if, detail::mp_exp > > >::type - operator / (const V& a, const detail::mp_exp >& b) -{ - return detail::mp_exp > >( - detail::mp_exp >(a, b.left_ref())); -} -// -// Modulus: -// -template -inline detail::mp_exp, mp_number > - operator % (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator % (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator % (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator % (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator % (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator % (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator % (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator % (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Left shift: -// -template -inline typename enable_if, detail::mp_exp, I > >::type - operator << (const mp_number& a, const I& b) -{ - return detail::mp_exp, I>(a, b); -} -template -inline typename enable_if, detail::mp_exp, I> >::type - operator << (const detail::mp_exp& a, const I& b) -{ - return detail::mp_exp, I>(a, b); -} -// -// Right shift: -// -template -inline typename enable_if, detail::mp_exp, I > >::type - operator >> (const mp_number& a, const I& b) -{ - return detail::mp_exp, I>(a, b); -} -template -inline typename enable_if, detail::mp_exp, I> >::type - operator >> (const detail::mp_exp& a, const I& b) -{ - return detail::mp_exp, I>(a, b); -} -// -// Bitwise AND: -// -template -inline detail::mp_exp, mp_number > - operator & (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator & (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator & (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator & (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator & (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator & (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator & (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator & (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Bitwise OR: -// -template -inline detail::mp_exp, mp_number > - operator| (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator| (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator| (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator| (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator| (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator| (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator| (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator| (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} -// -// Bitwise XOR: -// -template -inline detail::mp_exp, mp_number > - operator^ (const mp_number& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator^ (const mp_number& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator^ (const V& a, const mp_number& b) -{ - return detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator^ (const mp_number& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline detail::mp_exp, mp_number > - operator^ (const detail::mp_exp& a, const mp_number& b) -{ - return detail::mp_exp, mp_number >(a, b); -} -template -inline detail::mp_exp, detail::mp_exp > - operator^ (const detail::mp_exp& a, const detail::mp_exp& b) -{ - return detail::mp_exp, detail::mp_exp >(a, b); -} -template -inline typename enable_if, detail::mp_exp, V > >::type - operator^ (const detail::mp_exp& a, const V& b) -{ - return detail::mp_exp, V >(a, b); -} -template -inline typename enable_if, detail::mp_exp > >::type - operator^ (const V& a, const detail::mp_exp& b) -{ - return detail::mp_exp >(a, b); -} - -// -// Traits class, lets us know what kind of number we have, defaults to a floating point type: -// -enum number_category_type -{ - number_kind_integer = 0, - number_kind_floating_point = 1, - number_kind_rational = 2, - number_kind_fixed_point = 3 -}; - -template -struct number_category : public mpl::int_ {}; -template -struct number_category > : public number_category{}; -template -struct number_category > : public number_category::result_type>{}; - -template -struct component_type; -template -struct component_type > : public component_type{}; -template -struct component_type > : public component_type::result_type>{}; - -}} // namespaces - -namespace boost{ namespace math{ namespace tools{ - -template -struct promote_arg; - -template -struct promote_arg > -{ - typedef typename boost::multiprecision::detail::mp_exp::result_type type; -}; - -template -inline R real_cast(const boost::multiprecision::mp_number& val) -{ - return val.template convert_to(); -} - -template -inline R real_cast(const boost::multiprecision::detail::mp_exp& val) -{ - typedef typename boost::multiprecision::detail::mp_exp::result_type val_type; - return val_type(val).template convert_to(); -} - - -}}} - -#endif // BOOST_MATH_BIG_NUM_BASE_HPP - - diff --git a/include/boost/multiprecision/detail/mp_number_compare.hpp b/include/boost/multiprecision/detail/mp_number_compare.hpp deleted file mode 100644 index e8d53b9d..00000000 --- a/include/boost/multiprecision/detail/mp_number_compare.hpp +++ /dev/null @@ -1,482 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright 2012 John Maddock. Distributed under the Boost -// Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_MP_COMPARE_HPP -#define BOOST_MP_COMPARE_HPP - -// -// Comparison operators for mp_number. -// - -namespace boost{ namespace multiprecision{ - -namespace default_ops{ - -template -inline bool eval_eq(const B& a, const B& b) -{ - return a.compare(b) == 0; -} -template -inline bool eval_eq(const B& a, const A& b) -{ - typedef typename mpl::if_< - is_convertible >, - mp_number, - mp_number - >::type mp_type; - mp_type t(b); - return eval_eq(a, t.backend()); -} - -template -inline bool eval_lt(const B& a, const B& b) -{ - return a.compare(b) < 0; -} -template -inline bool eval_lt(const B& a, const A& b) -{ - typedef typename mpl::if_< - is_convertible >, - mp_number, - mp_number - >::type mp_type; - mp_type t(b); - return eval_lt(a, t.backend()); -} - -template -inline bool eval_gt(const B& a, const B& b) -{ - return a.compare(b) > 0; -} -template -inline bool eval_gt(const B& a, const A& b) -{ - typedef typename mpl::if_< - is_convertible >, - mp_number, - mp_number - >::type mp_type; - mp_type t(b); - return eval_gt(a, t.backend()); -} - -} - -template -inline bool operator == (const mp_number& a, const mp_number& b) -{ - using default_ops::eval_eq; - return eval_eq(a.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator == (const mp_number& a, const Arithmetic& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - return eval_eq(a.backend(), ct(b)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator == (const mp_number& a, const detail::mp_exp& b) -{ - using default_ops::eval_eq; - typename detail::mp_exp::result_type t(b); - return eval_eq(a.backend(), t.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator == (const Arithmetic& a, const mp_number& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - return eval_eq(b.backend(), ct(a)); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator == (const Arithmetic& a, const detail::mp_exp& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - result_type t(b); - return eval_eq(t.backend(), ct(a)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator == (const detail::mp_exp& a, const mp_number& b) -{ - using default_ops::eval_eq; - typename detail::mp_exp::result_type t(a); - return eval_eq(t.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator == (const detail::mp_exp& a, const Arithmetic& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - result_type t(a); - return eval_eq(t.backend(), ct(b)); -} -template -inline typename enable_if::result_type, typename detail::mp_exp::result_type>, bool>::type - operator == (const detail::mp_exp& a, const detail::mp_exp& b) -{ - using default_ops::eval_eq; - typename detail::mp_exp::result_type t(a); - typename detail::mp_exp::result_type t2(b); - return eval_eq(t.backend(), t2.backend()); -} - -template -inline bool operator != (const mp_number& a, const mp_number& b) -{ - using default_ops::eval_eq; - return !eval_eq(a.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator != (const mp_number& a, const Arithmetic& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - return !eval_eq(a.backend(), ct(b)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator != (const mp_number& a, const detail::mp_exp& b) -{ - using default_ops::eval_eq; - typename detail::mp_exp::result_type t(b); - return !eval_eq(a.backend(), t.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator != (const Arithmetic& a, const mp_number& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - return !eval_eq(b.backend(), ct(a)); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator != (const Arithmetic& a, const detail::mp_exp& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - result_type t(b); - return !eval_eq(t.backend(), ct(a)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator != (const detail::mp_exp& a, const mp_number& b) -{ - using default_ops::eval_eq; - typename detail::mp_exp::result_type t(a); - return !eval_eq(t.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator != (const detail::mp_exp& a, const Arithmetic& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_eq; - result_type t(a); - return !eval_eq(t.backend(), ct(b)); -} -template -inline typename enable_if::result_type, typename detail::mp_exp::result_type>, bool>::type - operator != (const detail::mp_exp& a, const detail::mp_exp& b) -{ - using default_ops::eval_eq; - typename detail::mp_exp::result_type t(a); - typename detail::mp_exp::result_type t2(b); - return !eval_eq(t.backend(), t2.backend()); -} - -template -inline bool operator < (const mp_number& a, const mp_number& b) -{ - using default_ops::eval_lt; - return eval_lt(a.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator < (const mp_number& a, const Arithmetic& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - return eval_lt(a.backend(), ct(b)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator < (const mp_number& a, const detail::mp_exp& b) -{ - using default_ops::eval_lt; - typename detail::mp_exp::result_type t(b); - return eval_lt(a.backend(), t.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator < (const Arithmetic& a, const mp_number& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - return eval_gt(b.backend(), ct(a)); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator < (const Arithmetic& a, const detail::mp_exp& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - result_type t(b); - return eval_gt(t.backend(), ct(a)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator < (const detail::mp_exp& a, const mp_number& b) -{ - using default_ops::eval_lt; - typename detail::mp_exp::result_type t(a); - return eval_lt(t.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator < (const detail::mp_exp& a, const Arithmetic& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - result_type t(a); - return eval_lt(t.backend(), ct(b)); -} -template -inline typename enable_if::result_type, typename detail::mp_exp::result_type>, bool>::type - operator < (const detail::mp_exp& a, const detail::mp_exp& b) -{ - using default_ops::eval_lt; - typename detail::mp_exp::result_type t(a); - typename detail::mp_exp::result_type t2(b); - return eval_lt(t.backend(), t2.backend()); -} - -template -inline bool operator > (const mp_number& a, const mp_number& b) -{ - using default_ops::eval_gt; - return eval_gt(a.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator > (const mp_number& a, const Arithmetic& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - return eval_gt(a.backend(), ct(b)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator > (const mp_number& a, const detail::mp_exp& b) -{ - using default_ops::eval_gt; - typename detail::mp_exp::result_type t(b); - return eval_gt(a.backend(), t.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator > (const Arithmetic& a, const mp_number& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - return eval_lt(b.backend(), ct(a)); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator > (const Arithmetic& a, const detail::mp_exp& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - result_type t(b); - return eval_lt(t.backend(), ct(a)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator > (const detail::mp_exp& a, const mp_number& b) -{ - using default_ops::eval_gt; - typename detail::mp_exp::result_type t(a); - return eval_gt(t.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator > (const detail::mp_exp& a, const Arithmetic& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - result_type t(a); - return eval_gt(t.backend(), ct(b)); -} -template -inline typename enable_if::result_type, typename detail::mp_exp::result_type>, bool>::type - operator > (const detail::mp_exp& a, const detail::mp_exp& b) -{ - using default_ops::eval_gt; - typename detail::mp_exp::result_type t(a); - typename detail::mp_exp::result_type t2(b); - return eval_gt(t.backend(), t2.backend()); -} - -template -inline bool operator <= (const mp_number& a, const mp_number& b) -{ - using default_ops::eval_gt; - return !eval_gt(a.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator <= (const mp_number& a, const Arithmetic& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - return !eval_gt(a.backend(), ct(b)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator <= (const mp_number& a, const detail::mp_exp& b) -{ - using default_ops::eval_gt; - typename detail::mp_exp::result_type t(b); - return !eval_gt(a.backend(), t.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator <= (const Arithmetic& a, const mp_number& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - return !eval_lt(b.backend(), ct(a)); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator <= (const Arithmetic& a, const detail::mp_exp& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - result_type t(b); - return !eval_lt(t.backend(), ct(a)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator <= (const detail::mp_exp& a, const mp_number& b) -{ - using default_ops::eval_gt; - typename detail::mp_exp::result_type t(a); - return !eval_gt(t.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator <= (const detail::mp_exp& a, const Arithmetic& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - result_type t(a); - return !eval_gt(t.backend(), ct(b)); -} -template -inline typename enable_if::result_type, typename detail::mp_exp::result_type>, bool>::type - operator <= (const detail::mp_exp& a, const detail::mp_exp& b) -{ - using default_ops::eval_gt; - typename detail::mp_exp::result_type t(a); - typename detail::mp_exp::result_type t2(b); - return !eval_gt(t.backend(), t2.backend()); -} - -template -inline bool operator >= (const mp_number& a, const mp_number& b) -{ - using default_ops::eval_lt; - return !eval_lt(a.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator >= (const mp_number& a, const Arithmetic& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - return !eval_lt(a.backend(), ct(b)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator >= (const mp_number& a, const detail::mp_exp& b) -{ - using default_ops::eval_lt; - typename detail::mp_exp::result_type t(b); - return !eval_lt(a.backend(), t.backend()); -} -template -inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator >= (const Arithmetic& a, const mp_number& b) -{ - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - return !eval_gt(b.backend(), ct(a)); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator >= (const Arithmetic& a, const detail::mp_exp& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_gt; - result_type t(b); - return !eval_gt(t.backend(), ct(a)); -} -template -inline typename enable_if, typename detail::mp_exp::result_type>, bool>::type - operator >= (const detail::mp_exp& a, const mp_number& b) -{ - using default_ops::eval_lt; - typename detail::mp_exp::result_type t(a); - return !eval_lt(t.backend(), b.backend()); -} -template -inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type - operator >= (const detail::mp_exp& a, const Arithmetic& b) -{ - typedef typename detail::mp_exp::result_type result_type; - typedef typename detail::canonical::type ct; - using default_ops::eval_lt; - result_type t(a); - return !eval_lt(t.backend(), ct(b)); -} -template -inline typename enable_if::result_type, typename detail::mp_exp::result_type>, bool>::type - operator >= (const detail::mp_exp& a, const detail::mp_exp& b) -{ - using default_ops::eval_lt; - typename detail::mp_exp::result_type t(a); - typename detail::mp_exp::result_type t2(b); - return !eval_lt(t.backend(), t2.backend()); -} - - -}} // namespaces - -#endif // BOOST_MP_COMPARE_HPP - diff --git a/include/boost/multiprecision/detail/no_et_ops.hpp b/include/boost/multiprecision/detail/no_et_ops.hpp index aa1ea7e6..28c7c6d4 100644 --- a/include/boost/multiprecision/detail/no_et_ops.hpp +++ b/include/boost/multiprecision/detail/no_et_ops.hpp @@ -10,21 +10,21 @@ namespace boost{ namespace multiprecision{ // -// Operators for non-expression template enabled mp_number. +// Operators for non-expression template enabled number. // NOTE: this is not a complete header - really just a suffix to default_ops.hpp. // NOTE: these operators have to be defined after the methods in default_ops.hpp. // template -inline mp_number operator - (const mp_number& v) +inline number operator - (const number& v) { - mp_number result(v); + number result(v); result.backend().negate(); return BOOST_MP_MOVE(result); } template -inline mp_number operator ~ (const mp_number& v) +inline number operator ~ (const number& v) { - mp_number result; + number result; eval_complement(result.backend(), v.backend()); return BOOST_MP_MOVE(result); } @@ -32,29 +32,29 @@ inline mp_number operator ~ (const mp_number& v) // Addition: // template -inline mp_number operator + (const mp_number& a, const mp_number& b) +inline number operator + (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_add; eval_add(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator + (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator + (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_add; eval_add(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator + (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator + (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_add; eval_add(result.backend(), b.backend(), static_cast(a)); return BOOST_MP_MOVE(result); @@ -63,29 +63,29 @@ inline typename enable_if, mp_number >::type // Subtraction: // template -inline mp_number operator - (const mp_number& a, const mp_number& b) +inline number operator - (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_subtract; eval_subtract(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator - (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator - (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_subtract; eval_subtract(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator - (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator - (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_subtract; eval_subtract(result.backend(), static_cast(a), b.backend()); return BOOST_MP_MOVE(result); @@ -94,29 +94,29 @@ inline typename enable_if, mp_number >::type // Multiply: // template -inline mp_number operator * (const mp_number& a, const mp_number& b) +inline number operator * (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_multiply; eval_multiply(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator * (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator * (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_multiply; eval_multiply(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator * (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator * (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_multiply; eval_multiply(result.backend(), b.backend(), static_cast(a)); return BOOST_MP_MOVE(result); @@ -125,29 +125,29 @@ inline typename enable_if, mp_number >::type // divide: // template -inline mp_number operator / (const mp_number& a, const mp_number& b) +inline number operator / (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_divide; eval_divide(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator / (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator / (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_divide; eval_divide(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator / (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator / (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_divide; eval_divide(result.backend(), static_cast(a), b.backend()); return BOOST_MP_MOVE(result); @@ -156,29 +156,29 @@ inline typename enable_if, mp_number >::type // modulus: // template -inline mp_number operator % (const mp_number& a, const mp_number& b) +inline number operator % (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_modulus; eval_modulus(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator % (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator % (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_modulus; eval_modulus(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator % (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator % (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_modulus; eval_modulus(result.backend(), static_cast(a), b.backend()); return BOOST_MP_MOVE(result); @@ -187,29 +187,29 @@ inline typename enable_if, mp_number >::type // Bitwise or: // template -inline mp_number operator | (const mp_number& a, const mp_number& b) +inline number operator | (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_bitwise_or; eval_bitwise_or(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator | (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator | (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_bitwise_or; eval_bitwise_or(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator | (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator | (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_bitwise_or; eval_bitwise_or(result.backend(), b.backend(), static_cast(a)); return BOOST_MP_MOVE(result); @@ -218,29 +218,29 @@ inline typename enable_if, mp_number >::type // Bitwise xor: // template -inline mp_number operator ^ (const mp_number& a, const mp_number& b) +inline number operator ^ (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_bitwise_xor; eval_bitwise_xor(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator ^ (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator ^ (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_bitwise_xor; eval_bitwise_xor(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator ^ (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator ^ (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_bitwise_xor; eval_bitwise_xor(result.backend(), b.backend(), static_cast(a)); return BOOST_MP_MOVE(result); @@ -249,29 +249,29 @@ inline typename enable_if, mp_number >::type // Bitwise and: // template -inline mp_number operator & (const mp_number& a, const mp_number& b) +inline number operator & (const number& a, const number& b) { - mp_number result; + number result; using default_ops::eval_bitwise_and; eval_bitwise_and(result.backend(), a.backend(), b.backend()); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator & (const mp_number& a, const V& b) +inline typename enable_if, number >::type + operator & (const number& a, const V& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_bitwise_and; eval_bitwise_and(result.backend(), a.backend(), static_cast(b)); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator & (const V& a, const mp_number& b) +inline typename enable_if, number >::type + operator & (const V& a, const number& b) { typedef typename detail::canonical::type canonical_type; - mp_number result; + number result; using default_ops::eval_bitwise_and; eval_bitwise_and(result.backend(), b.backend(), static_cast(a)); return BOOST_MP_MOVE(result); @@ -280,19 +280,19 @@ inline typename enable_if, mp_number >::type // shifts: // template -inline typename enable_if, mp_number >::type - operator << (const mp_number& a, const I& b) +inline typename enable_if, number >::type + operator << (const number& a, const I& b) { - mp_number result(a); + number result(a); using default_ops::eval_left_shift; eval_left_shift(result.backend(), b); return BOOST_MP_MOVE(result); } template -inline typename enable_if, mp_number >::type - operator >> (const mp_number& a, const I& b) +inline typename enable_if, number >::type + operator >> (const number& a, const I& b) { - mp_number result(a); + number result(a); using default_ops::eval_right_shift; eval_right_shift(result.backend(), b); return BOOST_MP_MOVE(result); @@ -311,327 +311,327 @@ inline typename enable_if, mp_number >::type // semantics help a great deal in return by value, so performance is still pretty good... // template -inline mp_number operator - (mp_number&& v) +inline number operator - (number&& v) { v.backend().negate(); - return static_cast&&>(v); + return static_cast&&>(v); } template -inline mp_number operator ~ (mp_number&& v) +inline number operator ~ (number&& v) { eval_complement(v.backend(), v.backend()); - return static_cast&&>(v); + return static_cast&&>(v); } // // Addition: // template -inline mp_number operator + (mp_number&& a, const mp_number& b) +inline number operator + (number&& a, const number& b) { using default_ops::eval_add; eval_add(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline mp_number operator + (const mp_number& a, mp_number&& b) +inline number operator + (const number& a, number&& b) { using default_ops::eval_add; eval_add(b.backend(), a.backend()); - return static_cast&&>(b); + return static_cast&&>(b); } template -inline mp_number operator + (mp_number&& a, mp_number&& b) +inline number operator + (number&& a, number&& b) { using default_ops::eval_add; eval_add(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator + (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator + (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_add; eval_add(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator + (const V& a, mp_number&& b) +inline typename enable_if, number >::type + operator + (const V& a, number&& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_add; eval_add(b.backend(), static_cast(a)); - return static_cast&&>(b); + return static_cast&&>(b); } // // Subtraction: // template -inline mp_number operator - (mp_number&& a, const mp_number& b) +inline number operator - (number&& a, const number& b) { using default_ops::eval_subtract; eval_subtract(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline mp_number operator - (const mp_number& a, mp_number&& b) +inline number operator - (const number& a, number&& b) { using default_ops::eval_subtract; eval_subtract(b.backend(), a.backend()); b.backend().negate(); - return static_cast&&>(b); + return static_cast&&>(b); } template -inline mp_number operator - (mp_number&& a, mp_number&& b) +inline number operator - (number&& a, number&& b) { using default_ops::eval_subtract; eval_subtract(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator - (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator - (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_subtract; eval_subtract(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator - (const V& a, mp_number&& b) +inline typename enable_if, number >::type + operator - (const V& a, number&& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_subtract; eval_subtract(b.backend(), static_cast(a)); b.backend().negate(); - return static_cast&&>(b); + return static_cast&&>(b); } // // Multiply: // template -inline mp_number operator * (mp_number&& a, const mp_number& b) +inline number operator * (number&& a, const number& b) { using default_ops::eval_multiply; eval_multiply(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline mp_number operator * (const mp_number& a, mp_number&& b) +inline number operator * (const number& a, number&& b) { using default_ops::eval_multiply; eval_multiply(b.backend(), a.backend()); - return static_cast&&>(b); + return static_cast&&>(b); } template -inline mp_number operator * (mp_number&& a, mp_number&& b) +inline number operator * (number&& a, number&& b) { using default_ops::eval_multiply; eval_multiply(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator * (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator * (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_multiply; eval_multiply(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator * (const V& a, mp_number&& b) +inline typename enable_if, number >::type + operator * (const V& a, number&& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_multiply; eval_multiply(b.backend(), static_cast(a)); - return static_cast&&>(b); + return static_cast&&>(b); } // // divide: // template -inline mp_number operator / (mp_number&& a, const mp_number& b) +inline number operator / (number&& a, const number& b) { using default_ops::eval_divide; eval_divide(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator / (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator / (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_divide; eval_divide(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } // // modulus: // template -inline mp_number operator % (mp_number&& a, const mp_number& b) +inline number operator % (number&& a, const number& b) { using default_ops::eval_modulus; eval_modulus(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator % (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator % (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_modulus; eval_modulus(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } // // Bitwise or: // template -inline mp_number operator | (mp_number&& a, const mp_number& b) +inline number operator | (number&& a, const number& b) { using default_ops::eval_bitwise_or; eval_bitwise_or(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline mp_number operator | (const mp_number& a, mp_number&& b) +inline number operator | (const number& a, number&& b) { using default_ops::eval_bitwise_or; eval_bitwise_or(b.backend(), a.backend()); - return static_cast&&>(b); + return static_cast&&>(b); } template -inline mp_number operator | (mp_number&& a, mp_number&& b) +inline number operator | (number&& a, number&& b) { using default_ops::eval_bitwise_or; eval_bitwise_or(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator | (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator | (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_bitwise_or; eval_bitwise_or(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator | (const V& a, mp_number&& b) +inline typename enable_if, number >::type + operator | (const V& a, number&& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_bitwise_or; eval_bitwise_or(b.backend(), static_cast(a)); - return static_cast&&>(b); + return static_cast&&>(b); } // // Bitwise xor: // template -inline mp_number operator ^ (mp_number&& a, const mp_number& b) +inline number operator ^ (number&& a, const number& b) { using default_ops::eval_bitwise_xor; eval_bitwise_xor(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline mp_number operator ^ (const mp_number& a, mp_number&& b) +inline number operator ^ (const number& a, number&& b) { using default_ops::eval_bitwise_xor; eval_bitwise_xor(b.backend(), a.backend()); - return static_cast&&>(b); + return static_cast&&>(b); } template -inline mp_number operator ^ (mp_number&& a, mp_number&& b) +inline number operator ^ (number&& a, number&& b) { using default_ops::eval_bitwise_xor; eval_bitwise_xor(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator ^ (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator ^ (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_bitwise_xor; eval_bitwise_xor(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator ^ (const V& a, mp_number&& b) +inline typename enable_if, number >::type + operator ^ (const V& a, number&& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_bitwise_xor; eval_bitwise_xor(b.backend(), static_cast(a)); - return static_cast&&>(b); + return static_cast&&>(b); } // // Bitwise and: // template -inline mp_number operator & (mp_number&& a, const mp_number& b) +inline number operator & (number&& a, const number& b) { using default_ops::eval_bitwise_and; eval_bitwise_and(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline mp_number operator & (const mp_number& a, mp_number&& b) +inline number operator & (const number& a, number&& b) { using default_ops::eval_bitwise_and; eval_bitwise_and(b.backend(), a.backend()); - return static_cast&&>(b); + return static_cast&&>(b); } template -inline mp_number operator & (mp_number&& a, mp_number&& b) +inline number operator & (number&& a, number&& b) { using default_ops::eval_bitwise_and; eval_bitwise_and(a.backend(), b.backend()); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator & (mp_number&& a, const V& b) +inline typename enable_if, number >::type + operator & (number&& a, const V& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_bitwise_and; eval_bitwise_and(a.backend(), static_cast(b)); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator & (const V& a, mp_number&& b) +inline typename enable_if, number >::type + operator & (const V& a, number&& b) { typedef typename detail::canonical::type canonical_type; using default_ops::eval_bitwise_and; eval_bitwise_and(b.backend(), static_cast(a)); - return static_cast&&>(b); + return static_cast&&>(b); } // // shifts: // template -inline typename enable_if, mp_number >::type - operator << (mp_number&& a, const I& b) +inline typename enable_if, number >::type + operator << (number&& a, const I& b) { using default_ops::eval_left_shift; eval_left_shift(a.backend(), b); - return static_cast&&>(a); + return static_cast&&>(a); } template -inline typename enable_if, mp_number >::type - operator >> (mp_number&& a, const I& b) +inline typename enable_if, number >::type + operator >> (number&& a, const I& b) { using default_ops::eval_right_shift; eval_right_shift(a.backend(), b); - return static_cast&&>(a); + return static_cast&&>(a); } #endif diff --git a/include/boost/multiprecision/detail/number_base.hpp b/include/boost/multiprecision/detail/number_base.hpp new file mode 100644 index 00000000..29f5379a --- /dev/null +++ b/include/boost/multiprecision/detail/number_base.hpp @@ -0,0 +1,1262 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2011 John Maddock. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_BIG_NUM_BASE_HPP +#define BOOST_MATH_BIG_NUM_BASE_HPP + +#include +#include +#include +#include + +namespace boost{ namespace multiprecision{ + +template +class number; + +template +struct is_mp_number : public mpl::false_ {}; + +template +struct is_mp_number > : public mpl::true_ {}; + +namespace detail{ + +// Forward-declare an expression wrapper +template +struct expression; + +} // namespace detail + +template +struct is_mp_number_expression : public mpl::false_ {}; + +template +struct is_mp_number_expression > : public mpl::true_ {}; + +namespace detail{ +// +// Workaround for missing abs(long long) on some compilers: +// +template +typename boost::enable_if, T>::type abs(const T& t) BOOST_NOEXCEPT +{ + return t < 0 ? -t : t; +} + +#define BOOST_MP_USING_ABS using std::abs; using boost::multiprecision::detail::abs; + +// +// Move support: +// +#ifndef BOOST_NO_RVALUE_REFERENCES +# define BOOST_MP_MOVE(x) std::move(x) +#else +# define BOOST_MP_MOVE(x) x +#endif + +template +struct has_enough_bits +{ + template + struct type : public mpl::bool_::digits >= b>{}; +}; + +template +struct canonical_imp +{ + typedef Val type; +}; +template +struct canonical_imp > +{ + typedef typename has_enough_bits::digits>::template type pred_type; + typedef typename mpl::find_if< + typename Backend::signed_types, + pred_type + >::type iter_type; + typedef typename mpl::deref::type type; +}; +template +struct canonical_imp > +{ + typedef typename has_enough_bits::digits>::template type pred_type; + typedef typename mpl::find_if< + typename Backend::unsigned_types, + pred_type + >::type iter_type; + typedef typename mpl::deref::type type; +}; +template +struct canonical_imp > +{ + typedef typename has_enough_bits::digits>::template type pred_type; + typedef typename mpl::find_if< + typename Backend::float_types, + pred_type + >::type iter_type; + typedef typename mpl::deref::type type; +}; +template +struct canonical_imp > +{ + typedef const char* type; +}; + +template +struct canonical +{ + typedef typename mpl::if_< + is_signed, + mpl::int_<0>, + typename mpl::if_< + is_unsigned, + mpl::int_<1>, + typename mpl::if_< + is_floating_point, + mpl::int_<2>, + typename mpl::if_< + mpl::or_< + is_convertible, + is_same + >, + mpl::int_<3>, + mpl::int_<4> + >::type + >::type + >::type + >::type tag_type; + + typedef typename canonical_imp::type type; +}; + +struct terminal{}; +struct negate{}; +struct plus{}; +struct minus{}; +struct multiplies{}; +struct divides{}; +struct modulus{}; +struct shift_left{}; +struct shift_right{}; +struct bitwise_and{}; +struct bitwise_or{}; +struct bitwise_xor{}; +struct bitwise_complement{}; +struct add_immediates{}; +struct subtract_immediates{}; +struct multiply_immediates{}; +struct divide_immediates{}; +struct modulus_immediates{}; +struct bitwise_and_immediates{}; +struct bitwise_or_immediates{}; +struct bitwise_xor_immediates{}; +struct complement_immediates{}; +struct function{}; + +template +struct backend_type; + +template +struct backend_type > +{ + typedef T type; +}; + +template +struct backend_type > +{ + typedef typename backend_type::result_type>::type type; +}; + + +template +struct is_mp_number : public mpl::false_{}; +template +struct is_mp_number > : public mpl::true_{}; +template +struct is_mp_number_exp : public mpl::false_{}; +template +struct is_mp_number_exp > : public mpl::true_{}; + +template +struct combine_expression; + +template +struct combine_expression, T2> +{ + typedef number type; +}; + +template +struct combine_expression > +{ + typedef number type; +}; + +template +struct combine_expression, number > +{ + typedef number type; +}; + +template +struct arg_type +{ + typedef expression type; +}; + +template +struct arg_type > +{ + typedef expression type; +}; + +template +struct unmentionable +{ + static void proc(){} +}; + +typedef void (*unmentionable_type)(); + +template +struct expression_storage +{ + typedef const T& type; +}; + +template +struct expression_storage +{ + typedef T* type; +}; + +template +struct expression_storage +{ + typedef const T* type; +}; + +template +struct expression_storage > +{ + typedef expression type; +}; + +template +struct expression +{ + typedef mpl::int_<1> arity; + typedef typename arg_type::type left_type; + typedef typename left_type::result_type result_type; + typedef tag tag_type; + + explicit expression(const Arg1& a) : arg(a) {} + + left_type left()const { return left_type(arg); } + + const Arg1& left_ref()const BOOST_NOEXCEPT { return arg; } + + static const unsigned depth = left_type::depth + 1; + + operator unmentionable_type()const + { + result_type r(*this); + return r ? &unmentionable::proc : 0; + } + +private: + typename expression_storage::type arg; + expression& operator=(const expression&); +}; + +template +struct expression +{ + typedef mpl::int_<0> arity; + typedef Arg1 result_type; + typedef terminal tag_type; + + explicit expression(const Arg1& a) : arg(a) {} + + const Arg1& value()const BOOST_NOEXCEPT { return arg; } + + static const unsigned depth = 0; + + operator unmentionable_type()const + { + return arg ? &unmentionable::proc : 0; + } + +private: + typename expression_storage::type arg; + expression& operator=(const expression&); +}; + +template +struct expression +{ + typedef mpl::int_<2> arity; + typedef typename arg_type::type left_type; + typedef typename arg_type::type right_type; + typedef typename left_type::result_type left_result_type; + typedef typename right_type::result_type right_result_type; + typedef typename combine_expression::type result_type; + typedef tag tag_type; + + expression(const Arg1& a1, const Arg2& a2) : arg1(a1), arg2(a2) {} + + left_type left()const { return left_type(arg1); } + right_type right()const { return right_type(arg2); } + const Arg1& left_ref()const BOOST_NOEXCEPT { return arg1; } + const Arg2& right_ref()const BOOST_NOEXCEPT { return arg2; } + + operator unmentionable_type()const + { + result_type r(*this); + return r ? &unmentionable::proc : 0; + } + + static const unsigned left_depth = left_type::depth + 1; + static const unsigned right_depth = right_type::depth + 1; + static const unsigned depth = left_depth > right_depth ? left_depth : right_depth; +private: + typename expression_storage::type arg1; + typename expression_storage::type arg2; + expression& operator=(const expression&); +}; + +template +struct expression +{ + typedef mpl::int_<3> arity; + typedef typename arg_type::type left_type; + typedef typename arg_type::type middle_type; + typedef typename arg_type::type right_type; + typedef typename left_type::result_type left_result_type; + typedef typename middle_type::result_type middle_result_type; + typedef typename right_type::result_type right_result_type; + typedef typename combine_expression< + left_result_type, + typename combine_expression::type + >::type result_type; + typedef tag tag_type; + + expression(const Arg1& a1, const Arg2& a2, const Arg3& a3) : arg1(a1), arg2(a2), arg3(a3) {} + + left_type left()const { return left_type(arg1); } + middle_type middle()const { return middle_type(arg2); } + right_type right()const { return right_type(arg3); } + const Arg1& left_ref()const BOOST_NOEXCEPT { return arg1; } + const Arg2& middle_ref()const BOOST_NOEXCEPT { return arg2; } + const Arg3& right_ref()const BOOST_NOEXCEPT { return arg3; } + + operator unmentionable_type()const + { + result_type r(*this); + return r ? &unmentionable::proc : 0; + } + + static const unsigned left_depth = left_type::depth + 1; + static const unsigned middle_depth = middle_type::depth + 1; + static const unsigned right_depth = right_type::depth + 1; + static const unsigned depth = left_depth > right_depth ? (left_depth > middle_depth ? left_depth : middle_depth) : (right_depth > middle_depth ? right_depth : middle_depth); +private: + typename expression_storage::type arg1; + typename expression_storage::type arg2; + typename expression_storage::type arg3; + expression& operator=(const expression&); +}; + +template +struct expression +{ + typedef mpl::int_<4> arity; + typedef typename arg_type::type left_type; + typedef typename arg_type::type left_middle_type; + typedef typename arg_type::type right_middle_type; + typedef typename arg_type::type right_type; + typedef typename left_type::result_type left_result_type; + typedef typename left_middle_type::result_type left_middle_result_type; + typedef typename right_middle_type::result_type right_middle_result_type; + typedef typename right_type::result_type right_result_type; + typedef typename combine_expression< + typename combine_expression< + typename combine_expression::type, + right_middle_result_type + >::type, + right_result_type + >::type result_type; + typedef tag tag_type; + + expression(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4) : arg1(a1), arg2(a2), arg3(a3), arg4(a4) {} + + left_type left()const { return left_type(arg1); } + left_middle_type left_middle()const { return left_middle_type(arg2); } + right_middle_type right_middle()const { return right_middle_type(arg3); } + right_type right()const { return right_type(arg4); } + const Arg1& left_ref()const BOOST_NOEXCEPT { return arg1; } + const Arg2& left_middle_ref()const BOOST_NOEXCEPT { return arg2; } + const Arg3& right_middle_ref()const BOOST_NOEXCEPT { return arg3; } + const Arg4& right_ref()const BOOST_NOEXCEPT { return arg4; } + + operator unmentionable_type()const + { + result_type r(*this); + return r ? &unmentionable::proc : 0; + } + + static const unsigned left_depth = left_type::depth + 1; + static const unsigned left_middle_depth = left_middle_type::depth + 1; + static const unsigned right_middle_depth = right_middle_type::depth + 1; + static const unsigned right_depth = right_type::depth + 1; + + static const unsigned left_max_depth = left_depth > left_middle_depth ? left_depth : left_middle_depth; + static const unsigned right_max_depth = right_depth > right_middle_depth ? right_depth : right_middle_depth; + + static const unsigned depth = left_max_depth > right_max_depth ? left_max_depth : right_max_depth; +private: + typename expression_storage::type arg1; + typename expression_storage::type arg2; + typename expression_storage::type arg3; + typename expression_storage::type arg4; + expression& operator=(const expression&); +}; + +template +struct digits2 +{ + BOOST_STATIC_ASSERT(std::numeric_limits::is_specialized); + BOOST_STATIC_ASSERT((std::numeric_limits::radix == 2) || (std::numeric_limits::radix == 10)); + // If we really have so many digits that this fails, then we're probably going to hit other problems anyway: + BOOST_STATIC_ASSERT(LONG_MAX / 1000 > (std::numeric_limits::digits + 1)); + static const long value = std::numeric_limits::radix == 10 ? (((std::numeric_limits::digits + 1) * 1000L) / 301L) : std::numeric_limits::digits; +}; + +#ifndef BOOST_MP_MIN_EXPONENT_DIGITS +#ifdef _MSC_VER +# define BOOST_MP_MIN_EXPONENT_DIGITS 2 +#else +# define BOOST_MP_MIN_EXPONENT_DIGITS 2 +#endif +#endif + +template +void format_float_string(S& str, boost::intmax_t my_exp, boost::intmax_t digits, std::ios_base::fmtflags f, bool iszero) +{ + typedef typename S::size_type size_type; + bool scientific = (f & std::ios_base::scientific) == std::ios_base::scientific; + bool fixed = (f & std::ios_base::fixed) == std::ios_base::fixed; + bool showpoint = (f & std::ios_base::showpoint) == std::ios_base::showpoint; + bool showpos = (f & std::ios_base::showpos) == std::ios_base::showpos; + + bool neg = str.size() && (str[0] == '-'); + + if(neg) + str.erase(0, 1); + + if(digits == 0) + { + digits = (std::max)(str.size(), size_type(16)); + } + + if(iszero || str.empty() || (str.find_first_not_of('0') == S::npos)) + { + // We will be printing zero, even though the value might not + // actually be zero (it just may have been rounded to zero). + str = "0"; + if(scientific || fixed) + { + str.append(1, '.'); + str.append(size_type(digits), '0'); + if(scientific) + str.append("e+00"); + } + else + { + if(showpoint) + { + str.append(1, '.'); + if(digits > 1) + str.append(size_type(digits - 1), '0'); + } + } + if(neg) + str.insert(0, 1, '-'); + else if(showpos) + str.insert(0, 1, '+'); + return; + } + + if(!fixed && !scientific && !showpoint) + { + // + // Suppress trailing zeros: + // + std::string::iterator pos = str.end(); + while(pos != str.begin() && *--pos == '0'){} + if(pos != str.end()) + ++pos; + str.erase(pos, str.end()); + if(str.empty()) + str = '0'; + } + else if(!fixed || (my_exp >= 0)) + { + // + // Pad out the end with zero's if we need to: + // + boost::intmax_t chars = str.size(); + chars = digits - chars; + if(scientific) + ++chars; + if(chars > 0) + { + str.append(static_cast(chars), '0'); + } + } + + if(fixed || (!scientific && (my_exp >= -4) && (my_exp < digits))) + { + if(1 + my_exp > static_cast(str.size())) + { + // Just pad out the end with zeros: + str.append(static_cast(1 + my_exp - str.size()), '0'); + if(showpoint || fixed) + str.append("."); + } + else if(my_exp + 1 < static_cast(str.size())) + { + if(my_exp < 0) + { + str.insert(0, static_cast(-1 - my_exp), '0'); + str.insert(0, "0."); + } + else + { + // Insert the decimal point: + str.insert(static_cast(my_exp + 1), 1, '.'); + } + } + else if(showpoint || fixed) // we have exactly the digits we require to left of the point + str += "."; + + if(fixed) + { + // We may need to add trailing zeros: + boost::intmax_t l = str.find('.') + 1; + l = digits - (str.size() - l); + if(l > 0) + str.append(size_type(l), '0'); + } + } + else + { + BOOST_MP_USING_ABS + // Scientific format: + if(showpoint || (str.size() > 1)) + str.insert(1, 1, '.'); + str.append(1, 'e'); + S e = boost::lexical_cast(abs(my_exp)); + if(e.size() < BOOST_MP_MIN_EXPONENT_DIGITS) + e.insert(0, BOOST_MP_MIN_EXPONENT_DIGITS-e.size(), '0'); + if(my_exp < 0) + e.insert(0, 1, '-'); + else + e.insert(0, 1, '+'); + str.append(e); + } + if(neg) + str.insert(0, 1, '-'); + else if(showpos) + str.insert(0, 1, '+'); +} + +} // namespace detail + +// +// Non-member operators for number: +// +// Unary operators first: +// +template +inline const number& operator + (const number& v) { return v; } +template +inline const detail::expression& operator + (const detail::expression& v) { return v; } +template +inline detail::expression > operator - (const number& v) { return detail::expression >(v); } +template +inline detail::expression > operator - (const detail::expression& v) { return detail::expression >(v); } +template +inline detail::expression > operator ~ (const number& v) { return detail::expression >(v); } +template +inline detail::expression > operator ~ (const detail::expression& v) { return detail::expression >(v); } +// +// Then addition: +// +template +inline detail::expression, number > + operator + (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator + (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator + (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator + (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator + (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator + (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator + (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator + (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: +// +template +inline detail::expression, typename detail::expression::left_type > + operator + (const number& a, const detail::expression& b) +{ + return detail::expression, typename detail::expression::left_type >(a, b.left_ref()); +} +template +inline detail::expression, typename detail::expression::left_type > + operator + (const detail::expression& a, const number& b) +{ + return detail::expression, typename detail::expression::left_type >(b, a.left_ref()); +} +template +inline detail::expression, number > + operator + (const number& a, const detail::expression >& b) +{ + return detail::expression, number >(a, b.left_ref()); +} +template +inline detail::expression, number > + operator + (const detail::expression >& a, const number& b) +{ + return detail::expression, number >(b, a.left_ref()); +} +template +inline typename enable_if, detail::expression > >::type + operator + (const detail::expression >& a, const V& b) +{ + return detail::expression >(b, a.left_ref()); +} +template +inline typename enable_if, detail::expression > >::type + operator + (const V& a, const detail::expression >& b) +{ + return detail::expression, number >(a, b.left_ref()); +} +// +// Subtraction: +// +template +inline detail::expression, number > + operator - (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator - (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator - (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator - (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator - (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator - (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator - (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator - (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: +// +template +inline detail::expression, typename detail::expression::left_type > + operator - (const number& a, const detail::expression& b) +{ + return detail::expression, typename detail::expression::left_type >(a, b.left_ref()); +} +template +inline detail::expression, typename detail::expression::left_type > > + operator - (const detail::expression& a, const number& b) +{ + return detail::expression, typename detail::expression::left_type > >( + detail::expression, typename detail::expression::left_type >(b, a.left_ref())); +} +template +inline detail::expression, number > + operator - (const number& a, const detail::expression >& b) +{ + return detail::expression, number >(a, b.left_ref()); +} +template +inline detail::expression, number > > + operator - (const detail::expression >& a, const number& b) +{ + return detail::expression, number > >( + detail::expression, number >(b, a.left_ref())); +} +template +inline typename enable_if, detail::expression, V > > >::type + operator - (const detail::expression >& a, const V& b) +{ + return detail::expression, V > >(detail::expression, V >(a.left_ref(), b)); +} +template +inline typename enable_if, detail::expression > >::type + operator - (const V& a, const detail::expression >& b) +{ + return detail::expression >(a, b.left_ref()); +} +// +// Multiplication: +// +template +inline detail::expression, number > + operator * (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator * (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator * (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator * (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator * (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator * (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator * (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator * (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: +// +template +inline detail::expression, typename detail::expression::left_type > > + operator * (const number& a, const detail::expression& b) +{ + return detail::expression, typename detail::expression::left_type > >( + detail::expression, typename detail::expression::left_type > (a, b.left_ref())); +} +template +inline detail::expression, typename detail::expression::left_type > > + operator * (const detail::expression& a, const number& b) +{ + return detail::expression, typename detail::expression::left_type > >( + detail::expression, typename detail::expression::left_type >(b, a.left_ref())); +} +template +inline detail::expression, number > > + operator * (const number& a, const detail::expression >& b) +{ + return detail::expression, number > >( + detail::expression, number >(a, b.left_ref())); +} +template +inline detail::expression, number > > + operator * (const detail::expression >& a, const number& b) +{ + return detail::expression, number > >( + detail::expression, number >(b, a.left_ref())); +} +template +inline typename enable_if, detail::expression, V > > >::type + operator * (const detail::expression >& a, const V& b) +{ + return detail::expression, V > > ( + detail::expression, V >(a.left_ref(), b)); +} +template +inline typename enable_if, detail::expression, V > > >::type + operator * (const V& a, const detail::expression >& b) +{ + return detail::expression, V > >( + detail::expression, V >(b.left_ref(), a)); +} +// +// Division: +// +template +inline detail::expression, number > + operator / (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator / (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator / (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator / (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator / (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator / (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator / (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator / (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Repeat operator for negated arguments: propagate the negation to the top level to avoid temporaries: +// +template +inline detail::expression, typename detail::expression::left_type > > + operator / (const number& a, const detail::expression& b) +{ + return detail::expression, typename detail::expression::left_type > >( + detail::expression, typename detail::expression::left_type >(a, b.left_ref())); +} +template +inline detail::expression::left_type, number > > + operator / (const detail::expression& a, const number& b) +{ + return detail::expression::left_type, number > >( + detail::expression::left_type, number >(a.left_ref(), b)); +} +template +inline detail::expression, number > > + operator / (const number& a, const detail::expression >& b) +{ + return detail::expression, number > >( + detail::expression, number >(a, b.left_ref())); +} +template +inline detail::expression, number > > + operator / (const detail::expression >& a, const number& b) +{ + return detail::expression, number > >( + detail::expression, number >(a.left_ref(), b)); +} +template +inline typename enable_if, detail::expression, V > > >::type + operator / (const detail::expression >& a, const V& b) +{ + return detail::expression, V > >( + detail::expression, V>(a.left_ref(), b)); +} +template +inline typename enable_if, detail::expression > > >::type + operator / (const V& a, const detail::expression >& b) +{ + return detail::expression > >( + detail::expression >(a, b.left_ref())); +} +// +// Modulus: +// +template +inline detail::expression, number > + operator % (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator % (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator % (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator % (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator % (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator % (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator % (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator % (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Left shift: +// +template +inline typename enable_if, detail::expression, I > >::type + operator << (const number& a, const I& b) +{ + return detail::expression, I>(a, b); +} +template +inline typename enable_if, detail::expression, I> >::type + operator << (const detail::expression& a, const I& b) +{ + return detail::expression, I>(a, b); +} +// +// Right shift: +// +template +inline typename enable_if, detail::expression, I > >::type + operator >> (const number& a, const I& b) +{ + return detail::expression, I>(a, b); +} +template +inline typename enable_if, detail::expression, I> >::type + operator >> (const detail::expression& a, const I& b) +{ + return detail::expression, I>(a, b); +} +// +// Bitwise AND: +// +template +inline detail::expression, number > + operator & (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator & (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator & (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator & (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator & (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator & (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator & (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator & (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Bitwise OR: +// +template +inline detail::expression, number > + operator| (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator| (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator| (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator| (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator| (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator| (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator| (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator| (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} +// +// Bitwise XOR: +// +template +inline detail::expression, number > + operator^ (const number& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator^ (const number& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator^ (const V& a, const number& b) +{ + return detail::expression >(a, b); +} +template +inline detail::expression, detail::expression > + operator^ (const number& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline detail::expression, number > + operator^ (const detail::expression& a, const number& b) +{ + return detail::expression, number >(a, b); +} +template +inline detail::expression, detail::expression > + operator^ (const detail::expression& a, const detail::expression& b) +{ + return detail::expression, detail::expression >(a, b); +} +template +inline typename enable_if, detail::expression, V > >::type + operator^ (const detail::expression& a, const V& b) +{ + return detail::expression, V >(a, b); +} +template +inline typename enable_if, detail::expression > >::type + operator^ (const V& a, const detail::expression& b) +{ + return detail::expression >(a, b); +} + +// +// Traits class, lets us know what kind of number we have, defaults to a floating point type: +// +enum number_category_type +{ + number_kind_integer = 0, + number_kind_floating_point = 1, + number_kind_rational = 2, + number_kind_fixed_point = 3 +}; + +template +struct number_category : public mpl::int_ {}; +template +struct number_category > : public number_category{}; +template +struct number_category > : public number_category::result_type>{}; + +template +struct component_type; +template +struct component_type > : public component_type{}; +template +struct component_type > : public component_type::result_type>{}; + +}} // namespaces + +namespace boost{ namespace math{ namespace tools{ + +template +struct promote_arg; + +template +struct promote_arg > +{ + typedef typename boost::multiprecision::detail::expression::result_type type; +}; + +template +inline R real_cast(const boost::multiprecision::number& val) +{ + return val.template convert_to(); +} + +template +inline R real_cast(const boost::multiprecision::detail::expression& val) +{ + typedef typename boost::multiprecision::detail::expression::result_type val_type; + return val_type(val).template convert_to(); +} + + +}}} + +#endif // BOOST_MATH_BIG_NUM_BASE_HPP + + diff --git a/include/boost/multiprecision/detail/number_compare.hpp b/include/boost/multiprecision/detail/number_compare.hpp new file mode 100644 index 00000000..7b881d73 --- /dev/null +++ b/include/boost/multiprecision/detail/number_compare.hpp @@ -0,0 +1,482 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MP_COMPARE_HPP +#define BOOST_MP_COMPARE_HPP + +// +// Comparison operators for number. +// + +namespace boost{ namespace multiprecision{ + +namespace default_ops{ + +template +inline bool eval_eq(const B& a, const B& b) +{ + return a.compare(b) == 0; +} +template +inline bool eval_eq(const B& a, const A& b) +{ + typedef typename mpl::if_< + is_convertible >, + number, + number + >::type mp_type; + mp_type t(b); + return eval_eq(a, t.backend()); +} + +template +inline bool eval_lt(const B& a, const B& b) +{ + return a.compare(b) < 0; +} +template +inline bool eval_lt(const B& a, const A& b) +{ + typedef typename mpl::if_< + is_convertible >, + number, + number + >::type mp_type; + mp_type t(b); + return eval_lt(a, t.backend()); +} + +template +inline bool eval_gt(const B& a, const B& b) +{ + return a.compare(b) > 0; +} +template +inline bool eval_gt(const B& a, const A& b) +{ + typedef typename mpl::if_< + is_convertible >, + number, + number + >::type mp_type; + mp_type t(b); + return eval_gt(a, t.backend()); +} + +} + +template +inline bool operator == (const number& a, const number& b) +{ + using default_ops::eval_eq; + return eval_eq(a.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator == (const number& a, const Arithmetic& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + return eval_eq(a.backend(), ct(b)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator == (const number& a, const detail::expression& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(b); + return eval_eq(a.backend(), t.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator == (const Arithmetic& a, const number& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + return eval_eq(b.backend(), ct(a)); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator == (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + result_type t(b); + return eval_eq(t.backend(), ct(a)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator == (const detail::expression& a, const number& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(a); + return eval_eq(t.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator == (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + result_type t(a); + return eval_eq(t.backend(), ct(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator == (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + return eval_eq(t.backend(), t2.backend()); +} + +template +inline bool operator != (const number& a, const number& b) +{ + using default_ops::eval_eq; + return !eval_eq(a.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator != (const number& a, const Arithmetic& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + return !eval_eq(a.backend(), ct(b)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator != (const number& a, const detail::expression& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(b); + return !eval_eq(a.backend(), t.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator != (const Arithmetic& a, const number& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + return !eval_eq(b.backend(), ct(a)); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator != (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + result_type t(b); + return !eval_eq(t.backend(), ct(a)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator != (const detail::expression& a, const number& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(a); + return !eval_eq(t.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator != (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_eq; + result_type t(a); + return !eval_eq(t.backend(), ct(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator != (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + return !eval_eq(t.backend(), t2.backend()); +} + +template +inline bool operator < (const number& a, const number& b) +{ + using default_ops::eval_lt; + return eval_lt(a.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator < (const number& a, const Arithmetic& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + return eval_lt(a.backend(), ct(b)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator < (const number& a, const detail::expression& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(b); + return eval_lt(a.backend(), t.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator < (const Arithmetic& a, const number& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + return eval_gt(b.backend(), ct(a)); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator < (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + result_type t(b); + return eval_gt(t.backend(), ct(a)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator < (const detail::expression& a, const number& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(a); + return eval_lt(t.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator < (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + result_type t(a); + return eval_lt(t.backend(), ct(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator < (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + return eval_lt(t.backend(), t2.backend()); +} + +template +inline bool operator > (const number& a, const number& b) +{ + using default_ops::eval_gt; + return eval_gt(a.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator > (const number& a, const Arithmetic& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + return eval_gt(a.backend(), ct(b)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator > (const number& a, const detail::expression& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(b); + return eval_gt(a.backend(), t.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator > (const Arithmetic& a, const number& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + return eval_lt(b.backend(), ct(a)); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator > (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + result_type t(b); + return eval_lt(t.backend(), ct(a)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator > (const detail::expression& a, const number& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(a); + return eval_gt(t.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator > (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + result_type t(a); + return eval_gt(t.backend(), ct(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator > (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + return eval_gt(t.backend(), t2.backend()); +} + +template +inline bool operator <= (const number& a, const number& b) +{ + using default_ops::eval_gt; + return !eval_gt(a.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator <= (const number& a, const Arithmetic& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + return !eval_gt(a.backend(), ct(b)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator <= (const number& a, const detail::expression& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(b); + return !eval_gt(a.backend(), t.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator <= (const Arithmetic& a, const number& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + return !eval_lt(b.backend(), ct(a)); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator <= (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + result_type t(b); + return !eval_lt(t.backend(), ct(a)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator <= (const detail::expression& a, const number& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(a); + return !eval_gt(t.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator <= (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + result_type t(a); + return !eval_gt(t.backend(), ct(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator <= (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + return !eval_gt(t.backend(), t2.backend()); +} + +template +inline bool operator >= (const number& a, const number& b) +{ + using default_ops::eval_lt; + return !eval_lt(a.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator >= (const number& a, const Arithmetic& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + return !eval_lt(a.backend(), ct(b)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator >= (const number& a, const detail::expression& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(b); + return !eval_lt(a.backend(), t.backend()); +} +template +inline typename enable_if_c<(is_convertible >::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator >= (const Arithmetic& a, const number& b) +{ + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + return !eval_gt(b.backend(), ct(a)); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator >= (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_gt; + result_type t(b); + return !eval_gt(t.backend(), ct(a)); +} +template +inline typename enable_if, typename detail::expression::result_type>, bool>::type + operator >= (const detail::expression& a, const number& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(a); + return !eval_lt(t.backend(), b.backend()); +} +template +inline typename enable_if_c<(is_convertible::result_type>::value && !is_mp_number_expression::value && !is_mp_number::value), bool>::type + operator >= (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + typedef typename detail::canonical::type ct; + using default_ops::eval_lt; + result_type t(a); + return !eval_lt(t.backend(), ct(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator >= (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + return !eval_lt(t.backend(), t2.backend()); +} + + +}} // namespaces + +#endif // BOOST_MP_COMPARE_HPP + diff --git a/include/boost/multiprecision/gmp.hpp b/include/boost/multiprecision/gmp.hpp index bc5549e2..b8d290f9 100644 --- a/include/boost/multiprecision/gmp.hpp +++ b/include/boost/multiprecision/gmp.hpp @@ -6,7 +6,7 @@ #ifndef BOOST_MATH_ER_GMP_BACKEND_HPP #define BOOST_MATH_ER_GMP_BACKEND_HPP -#include +#include #include #include #include @@ -1870,15 +1870,15 @@ inline bool eval_is_zero(const gmp_rational& val) { return mpq_sgn(val.data()) == 0; } -inline mp_number numerator(const mp_number& val) +inline number numerator(const number& val) { - mp_number result; + number result; mpz_set(result.backend().data(), (mpq_numref(val.backend().data()))); return result; } -inline mp_number denominator(const mp_number& val) +inline number denominator(const number& val) { - mp_number result; + number result; mpz_set(result.backend().data(), (mpq_denref(val.backend().data()))); return result; } @@ -2072,9 +2072,9 @@ using boost::multiprecision::backends::gmp_rational; using boost::multiprecision::backends::gmp_float; template <> -struct component_type > +struct component_type > { - typedef mp_number type; + typedef number type; }; template<> @@ -2082,13 +2082,13 @@ struct number_category : public mpl::int_{}; template<> struct number_category : public mpl::int_{}; -typedef mp_number > mpf_float_50; -typedef mp_number > mpf_float_100; -typedef mp_number > mpf_float_500; -typedef mp_number > mpf_float_1000; -typedef mp_number > mpf_float; -typedef mp_number mpz_int; -typedef mp_number mpq_rational; +typedef number > mpf_float_50; +typedef number > mpf_float_100; +typedef number > mpf_float_500; +typedef number > mpf_float_1000; +typedef number > mpf_float; +typedef number mpz_int; +typedef number mpq_rational; }} // namespaces @@ -2098,9 +2098,9 @@ namespace std{ // numeric_limits [partial] specializations for the types declared in this header: // template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; // @@ -2195,10 +2195,10 @@ private: { data_initializer() { - std::numeric_limits > >::epsilon(); - std::numeric_limits > >::round_error(); - (std::numeric_limits > >::min)(); - (std::numeric_limits > >::max)(); + std::numeric_limits > >::epsilon(); + std::numeric_limits > >::round_error(); + (std::numeric_limits > >::min)(); + (std::numeric_limits > >::max)(); } void do_nothing()const{} }; @@ -2206,12 +2206,12 @@ private: }; template -const typename numeric_limits, ExpressionTemplates> >::data_initializer numeric_limits, ExpressionTemplates> >::initializer; +const typename numeric_limits, ExpressionTemplates> >::data_initializer numeric_limits, ExpressionTemplates> >::initializer; template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = false; static number_type (min)() BOOST_NOEXCEPT { return number_type(); } @@ -2250,56 +2250,56 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif template -class numeric_limits > +class numeric_limits > { - typedef boost::multiprecision::mp_number number_type; + typedef boost::multiprecision::number number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; // @@ -2348,56 +2348,56 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; #endif template -class numeric_limits > +class numeric_limits > { - typedef boost::multiprecision::mp_number number_type; + typedef boost::multiprecision::number number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; // @@ -2447,49 +2447,49 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; #endif diff --git a/include/boost/multiprecision/miller_rabin.hpp b/include/boost/multiprecision/miller_rabin.hpp index 557114cd..f1961bf2 100644 --- a/include/boost/multiprecision/miller_rabin.hpp +++ b/include/boost/multiprecision/miller_rabin.hpp @@ -12,7 +12,7 @@ namespace boost{ namespace multiprecision{ template -bool check_small_factors(const mp_number& n) +bool check_small_factors(const number& n) { static const boost::uint32_t small_factors1[] = { 3u, 5u, 7u, 11u, 13u, 17u, 19u, 23u }; @@ -119,13 +119,13 @@ inline bool is_small_prime(unsigned n) template typename enable_if_c::value == number_kind_integer, bool>::type - miller_rabin_test(const mp_number& n, unsigned trials, Engine& gen) + miller_rabin_test(const number& n, unsigned trials, Engine& gen) { #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif - typedef mp_number number_type; + typedef number number_type; if(n <= 227) return is_small_prime(n.template convert_to()); @@ -179,23 +179,23 @@ typename enable_if_c::value == number_kind_integer, boo } template -bool miller_rabin_test(const mp_number& x, unsigned trials) +bool miller_rabin_test(const number& x, unsigned trials) { static mt19937 gen; return miller_rabin_test(x, trials, gen); } template -bool miller_rabin_test(const detail::mp_exp & n, unsigned trials, Engine& gen) +bool miller_rabin_test(const detail::expression & n, unsigned trials, Engine& gen) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; return miller_rabin_test(number_type(n), trials, gen); } template -bool miller_rabin_test(const detail::mp_exp & n, unsigned trials) +bool miller_rabin_test(const detail::expression & n, unsigned trials) { - typedef typename detail::mp_exp::result_type number_type; + typedef typename detail::expression::result_type number_type; return miller_rabin_test(number_type(n), trials); } diff --git a/include/boost/multiprecision/mpfr.hpp b/include/boost/multiprecision/mpfr.hpp index 63f98959..859e51b3 100644 --- a/include/boost/multiprecision/mpfr.hpp +++ b/include/boost/multiprecision/mpfr.hpp @@ -6,7 +6,7 @@ #ifndef BOOST_MATH_BN_MPFR_HPP #define BOOST_MATH_BN_MPFR_HPP -#include +#include #include #include #include @@ -897,7 +897,7 @@ inline void eval_trunc(mpfr_float_backend& result, const mpfr_float_ba { if(0 == mpfr_number_p(val.data())) { - result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, mp_number >(val), 0, boost::math::policies::policy<>()).backend(); + result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number >(val), 0, boost::math::policies::policy<>()).backend(); return; } mpfr_trunc(result.data(), val.data()); @@ -1046,11 +1046,11 @@ inline void eval_tanh(mpfr_float_backend& result, const mpfr_float_bac using boost::multiprecision::backends::mpfr_float_backend; -typedef mp_number > mpfr_float_50; -typedef mp_number > mpfr_float_100; -typedef mp_number > mpfr_float_500; -typedef mp_number > mpfr_float_1000; -typedef mp_number > mpfr_float; +typedef number > mpfr_float_50; +typedef number > mpfr_float_100; +typedef number > mpfr_float_500; +typedef number > mpfr_float_1000; +typedef number > mpfr_float; } // namespace multiprecision @@ -1064,7 +1064,7 @@ inline int digits() BOOST_NOEXCEPT return boost::multiprecision::backends::detail::get_default_precision(); } template <> -inline int digits, false> >() BOOST_NOEXCEPT +inline int digits, false> >() BOOST_NOEXCEPT { return boost::multiprecision::backends::detail::get_default_precision(); } @@ -1079,9 +1079,9 @@ namespace std{ // numeric_limits [partial] specializations for the types declared in this header: // template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_NOEXCEPT @@ -1198,12 +1198,12 @@ private: { data_initializer() { - std::numeric_limits > >::epsilon(); - std::numeric_limits > >::round_error(); - (std::numeric_limits > >::min)(); - (std::numeric_limits > >::max)(); - std::numeric_limits > >::infinity(); - std::numeric_limits > >::quiet_NaN(); + std::numeric_limits > >::epsilon(); + std::numeric_limits > >::round_error(); + (std::numeric_limits > >::min)(); + (std::numeric_limits > >::max)(); + std::numeric_limits > >::infinity(); + std::numeric_limits > >::quiet_NaN(); } void do_nothing()const{} }; @@ -1211,62 +1211,62 @@ private: }; template -const typename numeric_limits, ExpressionTemplates> >::data_initializer numeric_limits, ExpressionTemplates> >::initializer; +const typename numeric_limits, ExpressionTemplates> >::data_initializer numeric_limits, ExpressionTemplates> >::initializer; #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif template -class numeric_limits, ExpressionTemplates> > +class numeric_limits, ExpressionTemplates> > { - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = false; static number_type (min)() BOOST_NOEXCEPT { return number_type(0); } @@ -1305,49 +1305,49 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif } // namespace std diff --git a/include/boost/multiprecision/mp_number.hpp b/include/boost/multiprecision/number.hpp similarity index 86% rename from include/boost/multiprecision/mp_number.hpp rename to include/boost/multiprecision/number.hpp index 704cec15..15096180 100644 --- a/include/boost/multiprecision/mp_number.hpp +++ b/include/boost/multiprecision/number.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include // stream operators #include // EOF @@ -34,26 +34,26 @@ namespace boost{ namespace multiprecision{ #endif template -class mp_number +class number { - typedef mp_number self_type; + typedef number self_type; public: typedef Backend backend_type; - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number() BOOST_NOEXCEPT_IF(noexcept(Backend())) {} - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number(const mp_number& e) BOOST_NOEXCEPT_IF(noexcept(Backend(static_cast(std::declval())))) : m_backend(e.m_backend){} + BOOST_FORCEINLINE BOOST_CONSTEXPR number() BOOST_NOEXCEPT_IF(noexcept(Backend())) {} + BOOST_FORCEINLINE BOOST_CONSTEXPR number(const number& e) BOOST_NOEXCEPT_IF(noexcept(Backend(static_cast(std::declval())))) : m_backend(e.m_backend){} template - BOOST_FORCEINLINE mp_number(V v, typename enable_if_c< + BOOST_FORCEINLINE number(V v, typename enable_if_c< (boost::is_arithmetic::value || is_same::value || is_convertible::value) && !is_convertible::type, Backend>::value >::type* = 0) { m_backend = canonical_value(v); } template - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number(V v, typename enable_if_c< + BOOST_FORCEINLINE BOOST_CONSTEXPR number(V v, typename enable_if_c< (boost::is_arithmetic::value || is_same::value || is_convertible::value) && is_convertible::type, Backend>::value >::type* = 0) : m_backend(canonical_value(v)) {} - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number(const mp_number& e, unsigned digits10) + BOOST_FORCEINLINE BOOST_CONSTEXPR number(const number& e, unsigned digits10) : m_backend(e.m_backend, digits10){} /* // @@ -61,22 +61,22 @@ public: // which is arguably more useful. Disabled for now. // template - mp_number(V v, unsigned digits10, typename enable_if, is_same, is_convertible > >::type* dummy1 = 0) + number(V v, unsigned digits10, typename enable_if, is_same, is_convertible > >::type* dummy1 = 0) { m_backend.precision(digits10); m_backend = canonical_value(v); } */ template - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number(const mp_number& val) BOOST_NOEXCEPT_IF(noexcept(Backend(static_cast(std::declval())))) : m_backend(val.m_backend) {} + BOOST_FORCEINLINE BOOST_CONSTEXPR number(const number& val) BOOST_NOEXCEPT_IF(noexcept(Backend(static_cast(std::declval())))) : m_backend(val.m_backend) {} template - BOOST_FORCEINLINE mp_number(const mp_number& val, typename enable_if >::type* = 0) BOOST_NOEXCEPT_IF(noexcept(std::declval() = std::declval())) + BOOST_FORCEINLINE number(const number& val, typename enable_if >::type* = 0) BOOST_NOEXCEPT_IF(noexcept(std::declval() = std::declval())) { m_backend = val.backend(); } template - mp_number(const mp_number& val, typename disable_if >::type* = 0) + number(const number& val, typename disable_if >::type* = 0) { // // Attempt a generic interconvertion: @@ -84,39 +84,39 @@ public: detail::generic_interconvert(backend(), val.backend(), number_category(), number_category()); } template - BOOST_FORCEINLINE mp_number(V v1, V v2, typename enable_if, is_same, is_convertible > >::type* = 0) + BOOST_FORCEINLINE number(V v1, V v2, typename enable_if, is_same, is_convertible > >::type* = 0) { using default_ops::assign_components; assign_components(m_backend, canonical_value(v1), canonical_value(v2)); } template - BOOST_FORCEINLINE mp_number(const mp_number& v1, const mp_number& v2, typename enable_if >::type* = 0) + BOOST_FORCEINLINE number(const number& v1, const number& v2, typename enable_if >::type* = 0) { using default_ops::assign_components; assign_components(m_backend, v1.backend(), v2.backend()); } template - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number(V v, typename enable_if, mpl::not_, is_same, is_convertible > > > >::type* = 0) + BOOST_FORCEINLINE BOOST_CONSTEXPR number(V v, typename enable_if, mpl::not_, is_same, is_convertible > > > >::type* = 0) BOOST_NOEXCEPT_IF(noexcept(Backend(static_cast(std::declval())))) : m_backend(v){} template - mp_number& operator=(const detail::mp_exp& e) + number& operator=(const detail::expression& e) { - typedef typename is_same::result_type>::type tag_type; + typedef typename is_same::result_type>::type tag_type; do_assign(e, tag_type()); return *this; } - BOOST_FORCEINLINE mp_number& operator=(const mp_number& e) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) + BOOST_FORCEINLINE number& operator=(const number& e) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) { m_backend = e.m_backend; return *this; } template - BOOST_FORCEINLINE typename enable_if, is_same, is_convertible >, mp_number& >::type + BOOST_FORCEINLINE typename enable_if, is_same, is_convertible >, number& >::type operator=(const V& v) BOOST_NOEXCEPT_IF(noexcept(std::declval() = std::declval::type>())) { m_backend = canonical_value(v); @@ -124,7 +124,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mpl::not_, is_same, is_convertible > > >, mp_number& >::type + BOOST_FORCEINLINE typename enable_if, mpl::not_, is_same, is_convertible > > >, number& >::type operator=(const V& v) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) { m_backend = v; @@ -132,23 +132,23 @@ public: } template - BOOST_FORCEINLINE mp_number& operator=(const mp_number& v) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) + BOOST_FORCEINLINE number& operator=(const number& v) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) { m_backend = v.backend(); return *this; } template - BOOST_FORCEINLINE typename enable_if, mp_number& >::type - operator=(const mp_number& v) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) + BOOST_FORCEINLINE typename enable_if, number& >::type + operator=(const number& v) BOOST_NOEXCEPT_IF(noexcept(std::declval() = static_cast(std::declval()))) { m_backend = v.backend(); return *this; } template - typename disable_if, mp_number& >::type - operator=(const mp_number& v) + typename disable_if, number& >::type + operator=(const number& v) { // // Attempt a generic interconvertion: @@ -158,35 +158,35 @@ public: } template - mp_number(const detail::mp_exp& e) + number(const detail::expression& e) { *this = e; } #ifndef BOOST_NO_RVALUE_REFERENCES - BOOST_FORCEINLINE BOOST_CONSTEXPR mp_number(mp_number&& r) BOOST_NOEXCEPT : m_backend(static_cast(r.m_backend)){} - BOOST_FORCEINLINE mp_number& operator=(mp_number&& r) BOOST_NOEXCEPT + BOOST_FORCEINLINE BOOST_CONSTEXPR number(number&& r) BOOST_NOEXCEPT : m_backend(static_cast(r.m_backend)){} + BOOST_FORCEINLINE number& operator=(number&& r) BOOST_NOEXCEPT { m_backend = static_cast(r.m_backend); return *this; } #endif - mp_number& operator+=(const self_type& val) + number& operator+=(const self_type& val) { - do_add(detail::mp_exp(val), detail::terminal()); + do_add(detail::expression(val), detail::terminal()); return *this; } template - mp_number& operator+=(const detail::mp_exp& e) + number& operator+=(const detail::expression& e) { // Create a copy if e contains this, but not if we're just doing a // x += x if(contains_self(e) && !is_self(e)) { self_type temp(e); - do_add(detail::mp_exp(temp), detail::terminal()); + do_add(detail::expression(temp), detail::terminal()); } else { @@ -196,7 +196,7 @@ public: } template - typename enable_if, mp_number& >::type + typename enable_if, number& >::type operator+=(const V& v) { using default_ops::eval_add; @@ -204,14 +204,14 @@ public: return *this; } - mp_number& operator-=(const self_type& val) + number& operator-=(const self_type& val) { - do_subtract(detail::mp_exp(val), detail::terminal()); + do_subtract(detail::expression(val), detail::terminal()); return *this; } template - mp_number& operator-=(const detail::mp_exp& e) + number& operator-=(const detail::expression& e) { // Create a copy if e contains this: if(contains_self(e)) @@ -227,7 +227,7 @@ public: } template - typename enable_if, mp_number& >::type + typename enable_if, number& >::type operator-=(const V& v) { using default_ops::eval_subtract; @@ -236,21 +236,21 @@ public: } - mp_number& operator *= (const self_type& e) + number& operator *= (const self_type& e) { - do_multiplies(detail::mp_exp(e), detail::terminal()); + do_multiplies(detail::expression(e), detail::terminal()); return *this; } template - mp_number& operator*=(const detail::mp_exp& e) + number& operator*=(const detail::expression& e) { // Create a temporary if the RHS references *this, but not // if we're just doing an x *= x; if(contains_self(e) && !is_self(e)) { self_type temp(e); - do_multiplies(detail::mp_exp(temp), detail::terminal()); + do_multiplies(detail::expression(temp), detail::terminal()); } else { @@ -260,7 +260,7 @@ public: } template - typename enable_if, mp_number& >::type + typename enable_if, number& >::type operator*=(const V& v) { using default_ops::eval_multiply; @@ -268,14 +268,14 @@ public: return *this; } - mp_number& operator%=(const self_type& e) + number& operator%=(const self_type& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The modulus operation is only valid for integer types"); - do_modulus(detail::mp_exp(e), detail::terminal()); + do_modulus(detail::expression(e), detail::terminal()); return *this; } template - mp_number& operator%=(const detail::mp_exp& e) + number& operator%=(const detail::expression& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The modulus operation is only valid for integer types"); // Create a temporary if the RHS references *this: @@ -291,7 +291,7 @@ public: return *this; } template - typename enable_if, mp_number& >::type + typename enable_if, number& >::type operator%=(const V& v) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The modulus operation is only valid for integer types"); @@ -308,21 +308,21 @@ public: // execute the increment/decrement on destruction, but // correct implemetation will be tricky, so defered for now... // - BOOST_FORCEINLINE mp_number& operator++() + BOOST_FORCEINLINE number& operator++() { using default_ops::eval_increment; eval_increment(m_backend); return *this; } - BOOST_FORCEINLINE mp_number& operator--() + BOOST_FORCEINLINE number& operator--() { using default_ops::eval_decrement; eval_decrement(m_backend); return *this; } - BOOST_FORCEINLINE mp_number operator++(int) + inline number operator++(int) { using default_ops::eval_increment; self_type temp(*this); @@ -330,7 +330,7 @@ public: return BOOST_MP_MOVE(temp); } - BOOST_FORCEINLINE mp_number operator--(int) + inline number operator--(int) { using default_ops::eval_decrement; self_type temp(*this); @@ -339,7 +339,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mp_number&>::type operator <<= (V val) + BOOST_FORCEINLINE typename enable_if, number&>::type operator <<= (V val) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The left-shift operation is only valid for integer types"); check_shift_range(val, mpl::bool_<(sizeof(V) > sizeof(std::size_t))>(), is_signed()); @@ -348,7 +348,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mp_number&>::type operator >>= (V val) + BOOST_FORCEINLINE typename enable_if, number&>::type operator >>= (V val) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The right-shift operation is only valid for integer types"); check_shift_range(val, mpl::bool_<(sizeof(V) > sizeof(std::size_t))>(), is_signed()); @@ -356,20 +356,20 @@ public: return *this; } - BOOST_FORCEINLINE mp_number& operator /= (const self_type& e) + BOOST_FORCEINLINE number& operator /= (const self_type& e) { - do_divide(detail::mp_exp(e), detail::terminal()); + do_divide(detail::expression(e), detail::terminal()); return *this; } template - mp_number& operator/=(const detail::mp_exp& e) + number& operator/=(const detail::expression& e) { // Create a temporary if the RHS references *this: if(contains_self(e)) { self_type temp(e); - do_divide(detail::mp_exp(temp), detail::terminal()); + do_divide(detail::expression(temp), detail::terminal()); } else { @@ -379,7 +379,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mp_number& >::type + BOOST_FORCEINLINE typename enable_if, number& >::type operator/=(const V& v) { using default_ops::eval_divide; @@ -387,15 +387,15 @@ public: return *this; } - BOOST_FORCEINLINE mp_number& operator&=(const self_type& e) + BOOST_FORCEINLINE number& operator&=(const self_type& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise & operation is only valid for integer types"); - do_bitwise_and(detail::mp_exp(e), detail::terminal()); + do_bitwise_and(detail::expression(e), detail::terminal()); return *this; } template - mp_number& operator&=(const detail::mp_exp& e) + number& operator&=(const detail::expression& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise & operation is only valid for integer types"); // Create a temporary if the RHS references *this, but not @@ -413,7 +413,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mp_number& >::type + BOOST_FORCEINLINE typename enable_if, number& >::type operator&=(const V& v) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise & operation is only valid for integer types"); @@ -422,15 +422,15 @@ public: return *this; } - BOOST_FORCEINLINE mp_number& operator|=(const self_type& e) + BOOST_FORCEINLINE number& operator|=(const self_type& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise | operation is only valid for integer types"); - do_bitwise_or(detail::mp_exp(e), detail::terminal()); + do_bitwise_or(detail::expression(e), detail::terminal()); return *this; } template - mp_number& operator|=(const detail::mp_exp& e) + number& operator|=(const detail::expression& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise | operation is only valid for integer types"); // Create a temporary if the RHS references *this, but not @@ -448,7 +448,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mp_number& >::type + BOOST_FORCEINLINE typename enable_if, number& >::type operator|=(const V& v) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise | operation is only valid for integer types"); @@ -457,15 +457,15 @@ public: return *this; } - BOOST_FORCEINLINE mp_number& operator^=(const self_type& e) + BOOST_FORCEINLINE number& operator^=(const self_type& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise ^ operation is only valid for integer types"); - do_bitwise_xor(detail::mp_exp(e), detail::terminal()); + do_bitwise_xor(detail::expression(e), detail::terminal()); return *this; } template - mp_number& operator^=(const detail::mp_exp& e) + number& operator^=(const detail::expression& e) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise ^ operation is only valid for integer types"); if(contains_self(e)) @@ -481,7 +481,7 @@ public: } template - BOOST_FORCEINLINE typename enable_if, mp_number& >::type + BOOST_FORCEINLINE typename enable_if, number& >::type operator^=(const V& v) { BOOST_STATIC_ASSERT_MSG(number_category::value == number_kind_integer, "The bitwise ^ operation is only valid for integer types"); @@ -563,7 +563,7 @@ explicit operator T()const // // Comparison: // - BOOST_FORCEINLINE int compare(const mp_number& o)const + BOOST_FORCEINLINE int compare(const number& o)const BOOST_NOEXCEPT_IF(noexcept(std::declval().compare(std::declval()))) { return m_backend.compare(o.m_backend); @@ -586,16 +586,16 @@ explicit operator T()const } private: template - void do_assign(const detail::mp_exp& e, const mpl::true_&) + void do_assign(const detail::expression& e, const mpl::true_&) { do_assign(e, tag()); } template - void do_assign(const detail::mp_exp& e, const mpl::false_&) + void do_assign(const detail::expression& e, const mpl::false_&) { // The result of the expression isn't the same type as this - // create a temporary result and assign it to *this: - typedef typename detail::mp_exp::result_type temp_type; + typedef typename detail::expression::result_type temp_type; temp_type t(e); *this = t; } @@ -1083,7 +1083,7 @@ private: template void do_assign_function_1(const F& f, const Exp& val, const Tag&) { - mp_number t(val); + number t(val); f(m_backend, t.backend()); } template @@ -1139,7 +1139,7 @@ private: template void do_assign_function_3a(const F& f, const Exp1& val1, const Exp2& val2, const Exp3& val3, const Tag1&, const Tag2& t2, const Tag3& t3) { - mp_number t(val1); + number t(val1); do_assign_function_3b(f, BOOST_MP_MOVE(t), val2, val3, t2, t3); } template @@ -1150,7 +1150,7 @@ private: template void do_assign_function_3b(const F& f, const Exp1& val1, const Exp2& val2, const Exp3& val3, const Tag2& /*t2*/, const Tag3& t3) { - mp_number t(val2); + number t(val2); do_assign_function_3c(f, val1, BOOST_MP_MOVE(t), val3, t3); } template @@ -1161,7 +1161,7 @@ private: template void do_assign_function_3c(const F& f, const Exp1& val1, const Exp2& val2, const Exp3& val3, const Tag3& /*t3*/) { - mp_number t(val3); + number t(val3); do_assign_function_3c(f, val1, val2, BOOST_MP_MOVE(t), detail::terminal()); } @@ -1201,7 +1201,7 @@ private: void do_add(const Exp& e, const unknown&) { self_type temp(e); - do_add(detail::mp_exp(temp), detail::terminal()); + do_add(detail::expression(temp), detail::terminal()); } template @@ -1269,7 +1269,7 @@ private: void do_subtract(const Exp& e, const unknown&) { self_type temp(e); - do_subtract(detail::mp_exp(temp), detail::terminal()); + do_subtract(detail::expression(temp), detail::terminal()); } template @@ -1543,14 +1543,14 @@ private: template static BOOST_FORCEINLINE BOOST_CONSTEXPR const V& function_arg_value(const V& v) BOOST_NOEXCEPT { return v; } template - static BOOST_FORCEINLINE const A1& function_arg_value(const detail::mp_exp& exp) BOOST_NOEXCEPT { return exp.value(); } + static BOOST_FORCEINLINE const A1& function_arg_value(const detail::expression& exp) BOOST_NOEXCEPT { return exp.value(); } template - static BOOST_FORCEINLINE BOOST_CONSTEXPR const Backend& function_arg_value(const detail::mp_exp, A2, A3, A4>& exp) BOOST_NOEXCEPT { return exp.value().backend(); } + static BOOST_FORCEINLINE BOOST_CONSTEXPR const Backend& function_arg_value(const detail::expression, A2, A3, A4>& exp) BOOST_NOEXCEPT { return exp.value().backend(); } Backend m_backend; }; template -inline std::ostream& operator << (std::ostream& os, const mp_number& r) +inline std::ostream& operator << (std::ostream& os, const number& r) { std::streamsize d = os.precision(); std::string s = r.str(d, os.flags()); @@ -1569,9 +1569,9 @@ inline std::ostream& operator << (std::ostream& os, const mp_number -inline std::ostream& operator << (std::ostream& os, const mp_exp& r) +inline std::ostream& operator << (std::ostream& os, const expression& r) { - typedef typename mp_exp::result_type value_type; + typedef typename expression::result_type value_type; value_type temp(r); return os << temp; } @@ -1579,7 +1579,7 @@ inline std::ostream& operator << (std::ostream& os, const mp_exp -inline std::istream& operator >> (std::istream& is, mp_number& r) +inline std::istream& operator >> (std::istream& is, number& r) { std::string s; is >> s; @@ -1588,7 +1588,7 @@ inline std::istream& operator >> (std::istream& is, mp_number -BOOST_FORCEINLINE void swap(mp_number& a, mp_number& b) +BOOST_FORCEINLINE void swap(number& a, number& b) { a.swap(b); } @@ -1599,10 +1599,10 @@ template class rational; template -inline std::istream& operator >> (std::istream& is, rational >& r) +inline std::istream& operator >> (std::istream& is, rational >& r) { std::string s1; - multiprecision::mp_number v1, v2; + multiprecision::number v1, v2; char c; bool have_hex = false; @@ -1634,37 +1634,37 @@ inline std::istream& operator >> (std::istream& is, rational -typename enable_if, bool>::type operator == (const rational >& a, const Arithmetic& b) +typename enable_if, bool>::type operator == (const rational >& a, const Arithmetic& b) { - return a == multiprecision::mp_number(b); + return a == multiprecision::number(b); } template -typename enable_if, bool>::type operator == (const Arithmetic& b, const rational >& a) +typename enable_if, bool>::type operator == (const Arithmetic& b, const rational >& a) { - return a == multiprecision::mp_number(b); + return a == multiprecision::number(b); } template -typename enable_if, bool>::type operator != (const rational >& a, const Arithmetic& b) +typename enable_if, bool>::type operator != (const rational >& a, const Arithmetic& b) { - return a != multiprecision::mp_number(b); + return a != multiprecision::number(b); } template -typename enable_if, bool>::type operator != (const Arithmetic& b, const rational >& a) +typename enable_if, bool>::type operator != (const Arithmetic& b, const rational >& a) { - return a != multiprecision::mp_number(b); + return a != multiprecision::number(b); } template -inline multiprecision::mp_number numerator(const rational >& a) +inline multiprecision::number numerator(const rational >& a) { return a.numerator(); } template -inline multiprecision::mp_number denominator(const rational >& a) +inline multiprecision::number denominator(const rational >& a) { return a.denominator(); } @@ -1677,7 +1677,7 @@ template class sparse_vector_element; template -inline bool operator == (const sparse_vector_element& a, const ::boost::multiprecision::mp_number& b) +inline bool operator == (const sparse_vector_element& a, const ::boost::multiprecision::number& b) { typedef typename sparse_vector_element::const_reference ref_type; return static_cast(a) == b; diff --git a/include/boost/multiprecision/random.hpp b/include/boost/multiprecision/random.hpp index a76372a5..d60cfb72 100644 --- a/include/boost/multiprecision/random.hpp +++ b/include/boost/multiprecision/random.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_MP_RANDOM_HPP #define BOOST_MP_RANDOM_HPP -#include +#include namespace boost{ namespace random{ namespace detail{ // @@ -18,8 +18,8 @@ namespace boost{ namespace random{ namespace detail{ // UDT's and depricate/remove this header altogether. // template -boost::multiprecision::mp_number - generate_uniform_int(Engine& eng, const boost::multiprecision::mp_number& min_value, const boost::multiprecision::mp_number& max_value); +boost::multiprecision::number + generate_uniform_int(Engine& eng, const boost::multiprecision::number& min_value, const boost::multiprecision::number& max_value); }}} @@ -31,20 +31,20 @@ namespace random{ namespace detail{ template -struct subtract, true> +struct subtract, true> { - typedef boost::multiprecision::mp_number result_type; + typedef boost::multiprecision::number result_type; result_type operator()(result_type const& x, result_type const& y) { return x - y; } }; } template -class independent_bits_engine > +class independent_bits_engine > { public: typedef Engine base_type; - typedef boost::multiprecision::mp_number result_type; + typedef boost::multiprecision::number result_type; static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } @@ -199,11 +199,11 @@ private: }; template -class uniform_smallint > +class uniform_smallint > { public: - typedef boost::multiprecision::mp_number input_type; - typedef boost::multiprecision::mp_number result_type; + typedef boost::multiprecision::number input_type; + typedef boost::multiprecision::number result_type; class param_type { @@ -382,22 +382,22 @@ private: namespace detail{ template -struct select_uniform_01 > +struct select_uniform_01 > { template struct apply { - typedef new_uniform_01 > type; + typedef new_uniform_01 > type; }; }; template -boost::multiprecision::mp_number +boost::multiprecision::number generate_uniform_int( - Engine& eng, const boost::multiprecision::mp_number& min_value, const boost::multiprecision::mp_number& max_value, + Engine& eng, const boost::multiprecision::number& min_value, const boost::multiprecision::number& max_value, boost::mpl::true_ /** is_integral */) { - typedef boost::multiprecision::mp_number result_type; + typedef boost::multiprecision::number result_type; // Since we're using big-numbers, use the result type for all internal calculations: typedef result_type range_type; typedef result_type base_result; @@ -558,8 +558,8 @@ boost::multiprecision::mp_number } template -inline boost::multiprecision::mp_number - generate_uniform_int(Engine& eng, const boost::multiprecision::mp_number& min_value, const boost::multiprecision::mp_number& max_value) +inline boost::multiprecision::number + generate_uniform_int(Engine& eng, const boost::multiprecision::number& min_value, const boost::multiprecision::number& max_value) { typedef typename Engine::result_type base_result; typedef typename mpl::or_, mpl::bool_::value == boost::multiprecision::number_kind_integer> >::type tag_type; diff --git a/include/boost/multiprecision/rational_adapter.hpp b/include/boost/multiprecision/rational_adapter.hpp index f3e4cd47..06fe7eb1 100644 --- a/include/boost/multiprecision/rational_adapter.hpp +++ b/include/boost/multiprecision/rational_adapter.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include namespace boost{ @@ -21,7 +21,7 @@ namespace backends{ template struct rational_adapter { - typedef mp_number integer_type; + typedef number integer_type; typedef boost::rational rational_type; typedef typename IntBackend::signed_types signed_types; @@ -62,7 +62,7 @@ struct rational_adapter rational_adapter& operator = (const char* s) { std::string s1; - multiprecision::mp_number v1, v2; + multiprecision::number v1, v2; char c; bool have_hex = false; const char* p = s; // saved for later @@ -178,12 +178,12 @@ inline int eval_get_sign(const rational_adapter& val) } template -inline mp_number numerator(const mp_number >& val) +inline number numerator(const number >& val) { return val.backend().data().numerator(); } template -inline mp_number denominator(const mp_number >& val) +inline number denominator(const number >& val) { return val.backend().data().denominator(); } @@ -204,7 +204,7 @@ using boost::multiprecision::backends::rational_adapter; template struct component_type > { - typedef mp_number type; + typedef number type; }; }} // namespaces @@ -213,10 +213,10 @@ struct component_type > namespace std{ template -class numeric_limits, ExpressionTemplates> > : public std::numeric_limits > +class numeric_limits, ExpressionTemplates> > : public std::numeric_limits > { - typedef std::numeric_limits > base_type; - typedef boost::multiprecision::mp_number > number_type; + typedef std::numeric_limits > base_type; + typedef boost::multiprecision::number > number_type; public: BOOST_STATIC_CONSTEXPR bool is_integer = false; BOOST_STATIC_CONSTEXPR bool is_exact = true; @@ -234,9 +234,9 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; #endif diff --git a/include/boost/multiprecision/tommath.hpp b/include/boost/multiprecision/tommath.hpp index eee4b341..0068ffde 100644 --- a/include/boost/multiprecision/tommath.hpp +++ b/include/boost/multiprecision/tommath.hpp @@ -6,7 +6,7 @@ #ifndef BOOST_MATH_MP_TOMMATH_BACKEND_HPP #define BOOST_MATH_MP_TOMMATH_BACKEND_HPP -#include +#include #include #include #include @@ -603,18 +603,18 @@ using boost::multiprecision::backends::tommath_int; template<> struct number_category : public mpl::int_{}; -typedef mp_number tom_int; +typedef number tom_int; typedef rational_adapter tommath_rational; -typedef mp_number tom_rational; +typedef number tom_rational; }} // namespaces namespace std{ template -class numeric_limits > +class numeric_limits > { - typedef boost::multiprecision::mp_number number_type; + typedef boost::multiprecision::number number_type; public: BOOST_STATIC_CONSTEXPR bool is_specialized = true; // @@ -663,49 +663,49 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; template -BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; template -BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; template -BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; template -BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; #endif } diff --git a/performance/arithmetic_backend.hpp b/performance/arithmetic_backend.hpp index 676c82d2..3e9028a2 100644 --- a/performance/arithmetic_backend.hpp +++ b/performance/arithmetic_backend.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include namespace boost{ @@ -523,10 +523,10 @@ inline double real_cast(concepts::real_concept r namespace std{ template -class numeric_limits, ExpressionTemplates > > : public std::numeric_limits +class numeric_limits, ExpressionTemplates > > : public std::numeric_limits { typedef std::numeric_limits base_type; - typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; + typedef boost::multiprecision::number, ExpressionTemplates> number_type; public: BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_NOEXCEPT { return (base_type::min)(); } BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_NOEXCEPT { return (base_type::max)(); } diff --git a/performance/delaunay_test.cpp b/performance/delaunay_test.cpp index 62a03981..cb4ba42c 100644 --- a/performance/delaunay_test.cpp +++ b/performance/delaunay_test.cpp @@ -270,14 +270,14 @@ int main() std::cout << "calculating...\n"; do_calc >("int64_t, int64_t"); - do_calc, false>, mp_number, false> > >("arithmetic_backend"); + do_calc, false>, number, false> > >("arithmetic_backend"); do_calc >("int64_t, int128_t"); - do_calc >("int64_t, mp_int128_t"); - do_calc, true> > >("int64_t, mp_int128_t (ET)"); + do_calc >("int64_t, int128_t"); + do_calc, true> > >("int64_t, int128_t (ET)"); do_calc >("int64_t, cpp_int"); - do_calc, false> > >("int64_t, cpp_int (no ET's)"); - do_calc > > >("int64_t, cpp_int(128-bit cache)"); - do_calc, false> > >("int64_t, cpp_int (128-bit Cache no ET's)"); + do_calc, false> > >("int64_t, cpp_int (no ET's)"); + do_calc > > >("int64_t, cpp_int(128-bit cache)"); + do_calc, false> > >("int64_t, cpp_int (128-bit Cache no ET's)"); return 0; } diff --git a/performance/linpack-benchmark.cpp b/performance/linpack-benchmark.cpp index 8db9b096..ec21f437 100644 --- a/performance/linpack-benchmark.cpp +++ b/performance/linpack-benchmark.cpp @@ -93,9 +93,9 @@ int dmxpy_(integer *, real_type *, integer *, integer *, real_type *, real_type extern "C" int MAIN__() { #ifdef TEST_MPF_50 - std::cout << "Testing mp_number >" << std::endl; + std::cout << "Testing number >" << std::endl; #elif defined(TEST_MPFR_50) - std::cout << "Testing mp_number >" << std::endl; + std::cout << "Testing number >" << std::endl; #elif defined(TEST_GMPXX) std::cout << "Testing mpf_class at 50 decimal degits" << std::endl; mpf_set_default_prec(((50 + 1) * 1000L) / 301L); @@ -103,7 +103,7 @@ extern "C" int MAIN__() std::cout << "Testing mpfr_class at 50 decimal degits" << std::endl; mpfr_set_default_prec(((50 + 1) * 1000L) / 301L); #elif defined(TEST_CPP_DEC_FLOAT) - std::cout << "Testing mp_number >" << std::endl; + std::cout << "Testing number >" << std::endl; #else std::cout << "Testing double" << std::endl; #endif @@ -1221,7 +1221,7 @@ times for array with leading dimension of1001 266.45 0.798 267.24 2.5021 0.79933 4772.2 -mp_number >: +number >: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ norm. resid resid machep x(1) x(n) diff --git a/performance/miller_rabin_performance.cpp b/performance/miller_rabin_performance.cpp index 9667aa51..fe202391 100644 --- a/performance/miller_rabin_performance.cpp +++ b/performance/miller_rabin_performance.cpp @@ -136,21 +136,21 @@ int main() { using namespace boost::multiprecision; #ifdef TEST_CPP_INT - test_miller_rabin, false> >("cpp_int (no Expression templates)"); + test_miller_rabin, false> >("cpp_int (no Expression templates)"); test_miller_rabin("cpp_int"); - test_miller_rabin > >("cpp_int (128-bit cache)"); - test_miller_rabin > >("cpp_int (256-bit cache)"); - test_miller_rabin > >("cpp_int (512-bit cache)"); - test_miller_rabin > >("cpp_int (1024-bit cache)"); - test_miller_rabin("mp_int1024_t"); + test_miller_rabin > >("cpp_int (128-bit cache)"); + test_miller_rabin > >("cpp_int (256-bit cache)"); + test_miller_rabin > >("cpp_int (512-bit cache)"); + test_miller_rabin > >("cpp_int (1024-bit cache)"); + test_miller_rabin("int1024_t"); #endif #ifdef TEST_MPZ - test_miller_rabin >("mpz_int (no Expression templates)"); + test_miller_rabin >("mpz_int (no Expression templates)"); test_miller_rabin("mpz_int"); std::cout << "Time for mpz_int (native Miller Rabin Test) = " << test_miller_rabin_gmp() << std::endl; #endif #ifdef TEST_TOMMATH - test_miller_rabin >("tom_int (no Expression templates)"); + test_miller_rabin >("tom_int (no Expression templates)"); test_miller_rabin("tom_int"); #endif mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); diff --git a/performance/performance_test.cpp b/performance/performance_test.cpp index dcc93932..4c58e672 100644 --- a/performance/performance_test.cpp +++ b/performance/performance_test.cpp @@ -786,12 +786,12 @@ int main() test("gmp_int", 1024); #endif #ifdef TEST_CPP_INT - test, false > >("cpp_int(unsigned, fixed)", 64); - test, false > >("cpp_int(fixed)", 64); - test, false > >("cpp_int(fixed)", 128); - test, false > >("cpp_int(fixed)", 256); - test, false > >("cpp_int(fixed)", 512); - test, false > >("cpp_int(fixed)", 1024); + test, false > >("cpp_int(unsigned, fixed)", 64); + test, false > >("cpp_int(fixed)", 64); + test, false > >("cpp_int(fixed)", 128); + test, false > >("cpp_int(fixed)", 256); + test, false > >("cpp_int(fixed)", 512); + test, false > >("cpp_int(fixed)", 1024); test("cpp_int", 128); test("cpp_int", 256); @@ -828,7 +828,7 @@ int main() #ifdef TEST_CPP_DEC_FLOAT test("cpp_dec_float", 50); test("cpp_dec_float", 100); - test > >("cpp_dec_float", 500); + test > >("cpp_dec_float", 500); #endif #ifdef TEST_MPFR test("mpfr_float", 50); diff --git a/performance/sf_performance.cpp b/performance/sf_performance.cpp index 3646e1b3..d2f95d07 100644 --- a/performance/sf_performance.cpp +++ b/performance/sf_performance.cpp @@ -233,7 +233,7 @@ int main() std::cout << "Allocation Counts for Horner Evaluation:\n"; #ifdef TEST_MPFR basic_allocation_test("mpfr_float_50", mpfr_float_50(2)); - basic_allocation_test("mpfr_float_50 - no expression templates", mp_number, false>(2)); + basic_allocation_test("mpfr_float_50 - no expression templates", number, false>(2)); #endif #ifdef TEST_MPFR_CLASS basic_allocation_test("mpfr_class", mpfr_class(2)); @@ -245,7 +245,7 @@ int main() std::cout << "Allocation Counts for boost::math::tools::evaluate_polynomial:\n"; #ifdef TEST_MPFR poly_allocation_test("mpfr_float_50", mpfr_float_50(2)); - poly_allocation_test("mpfr_float_50 - no expression templates", mp_number, false>(2)); + poly_allocation_test("mpfr_float_50 - no expression templates", number, false>(2)); #endif #ifdef TEST_MPFR_CLASS poly_allocation_test("mpfr_class", mpfr_class(2)); @@ -260,13 +260,13 @@ int main() #ifdef TEST_FLOAT time_proc("Bessel Functions - double", test_bessel); time_proc("Bessel Functions - real_concept", test_bessel); - time_proc("Bessel Functions - arithmetic_backend", test_bessel > >); - time_proc("Bessel Functions - arithmetic_backend - no expression templates", test_bessel, false> >); + time_proc("Bessel Functions - arithmetic_backend", test_bessel > >); + time_proc("Bessel Functions - arithmetic_backend - no expression templates", test_bessel, false> >); time_proc("Non-central T - double", test_nct); time_proc("Non-central T - real_concept", test_nct); - time_proc("Non-central T - arithmetic_backend", test_nct > >); - time_proc("Non-central T - arithmetic_backend - no expression templates", test_nct, false> >); + time_proc("Non-central T - arithmetic_backend", test_nct > >); + time_proc("Non-central T - arithmetic_backend - no expression templates", test_nct, false> >); #endif // @@ -288,7 +288,7 @@ int main() #endif #ifdef TEST_MPF time_proc("mpf_float_50", test_bessel, 3); - time_proc("mpf_float_50 (no expression templates", test_bessel, false> >, 3); + time_proc("mpf_float_50 (no expression templates", test_bessel, false> >, 3); #endif #ifdef TEST_CPP_DEC_FLOAT time_proc("cpp_dec_float_50", test_bessel, 3); @@ -314,7 +314,7 @@ int main() #endif #ifdef TEST_MPF time_proc("mpf_float_100", test_bessel); - time_proc("mpf_float_100 (no expression templates", test_bessel, false> >); + time_proc("mpf_float_100 (no expression templates", test_bessel, false> >); #endif #ifdef TEST_CPP_DEC_FLOAT time_proc("cpp_dec_float_100", test_bessel); @@ -341,7 +341,7 @@ int main() #endif #ifdef TEST_MPF time_proc("mpf_float_50", test_polynomial); - time_proc("mpf_float_50 (no expression templates", test_polynomial, false> >); + time_proc("mpf_float_50 (no expression templates", test_polynomial, false> >); #endif #ifdef TEST_CPP_DEC_FLOAT time_proc("cpp_dec_float_50", test_polynomial); @@ -367,7 +367,7 @@ int main() #endif #ifdef TEST_MPF time_proc("mpf_float_100", test_polynomial); - time_proc("mpf_float_100 (no expression templates", test_polynomial, false> >); + time_proc("mpf_float_100 (no expression templates", test_polynomial, false> >); #endif #ifdef TEST_CPP_DEC_FLOAT time_proc("cpp_dec_float_100", test_polynomial); @@ -393,7 +393,7 @@ int main() #endif #ifdef TEST_MPF time_proc("mpf_float_50", test_nct); - time_proc("mpf_float_50 (no expression templates", test_nct, false> >); + time_proc("mpf_float_50 (no expression templates", test_nct, false> >); #endif #ifdef TEST_CPP_DEC_FLOAT time_proc("cpp_dec_float_50", test_nct); @@ -419,7 +419,7 @@ int main() #endif #ifdef TEST_MPF time_proc("mpf_float_100", test_nct); - time_proc("mpf_float_100 (no expression templates", test_nct, false> >); + time_proc("mpf_float_100 (no expression templates", test_nct, false> >); #endif #ifdef TEST_CPP_DEC_FLOAT time_proc("cpp_dec_float_100", test_nct); diff --git a/test/concepts/mp_number_concept_check.cpp b/test/concepts/number_concept_check.cpp similarity index 85% rename from test/concepts/mp_number_concept_check.cpp rename to test/concepts/number_concept_check.cpp index d921dce7..106fbe5a 100644 --- a/test/concepts/mp_number_concept_check.cpp +++ b/test/concepts/number_concept_check.cpp @@ -171,22 +171,22 @@ void foo() test_extra(boost::multiprecision::mpfr_float_50()); #endif #ifdef TEST_MPFR_6 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_15 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_17 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_30 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_CPP_DEC_FLOAT test_extra(boost::multiprecision::cpp_dec_float_50()); #endif #ifdef TEST_CPP_DEC_FLOAT_NO_ET - test_extra(boost::multiprecision::mp_number, false>()); + test_extra(boost::multiprecision::number, false>()); #endif } @@ -202,16 +202,16 @@ int main() BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept)); #endif #ifdef TEST_MPFR_6 - BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); + BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); #endif #ifdef TEST_MPFR_15 - BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); + BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); #endif #ifdef TEST_MPFR_17 - BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); + BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); #endif #ifdef TEST_MPFR_30 - BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); + BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept > >)); #endif #ifdef TEST_MPFR_50 BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept)); diff --git a/test/concepts/sf_concept_check_basic.cpp b/test/concepts/sf_concept_check_basic.cpp index 75c35b08..16cecfce 100644 --- a/test/concepts/sf_concept_check_basic.cpp +++ b/test/concepts/sf_concept_check_basic.cpp @@ -124,22 +124,22 @@ void foo() test_extra(boost::multiprecision::mpfr_float_50()); #endif #ifdef TEST_MPFR_6 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_15 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_17 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_30 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_CPP_DEC_FLOAT test_extra(boost::multiprecision::cpp_dec_float_50()); #endif #ifdef TEST_CPP_DEC_FLOAT_NO_ET - test_extra(boost::multiprecision::mp_number, false>()); + test_extra(boost::multiprecision::number, false>()); #endif } diff --git a/test/concepts/sf_concept_check_bessel.cpp b/test/concepts/sf_concept_check_bessel.cpp index 12a40a13..0c3c3935 100644 --- a/test/concepts/sf_concept_check_bessel.cpp +++ b/test/concepts/sf_concept_check_bessel.cpp @@ -89,22 +89,22 @@ void foo() test_extra(boost::multiprecision::mpfr_float_50()); #endif #ifdef TEST_MPFR_6 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_15 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_17 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_30 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_CPP_DEC_FLOAT test_extra(boost::multiprecision::cpp_dec_float_50()); #endif #ifdef TEST_CPP_DEC_FLOAT_NO_ET - test_extra(boost::multiprecision::mp_number, false>()); + test_extra(boost::multiprecision::number, false>()); #endif } diff --git a/test/concepts/sf_concept_check_elliptic.cpp b/test/concepts/sf_concept_check_elliptic.cpp index e754f53e..e55cace4 100644 --- a/test/concepts/sf_concept_check_elliptic.cpp +++ b/test/concepts/sf_concept_check_elliptic.cpp @@ -95,22 +95,22 @@ void foo() test_extra(boost::multiprecision::mpfr_float_50()); #endif #ifdef TEST_MPFR_6 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_15 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_17 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_30 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_CPP_DEC_FLOAT test_extra(boost::multiprecision::cpp_dec_float_50()); #endif #ifdef TEST_CPP_DEC_FLOAT_NO_ET - test_extra(boost::multiprecision::mp_number, false>()); + test_extra(boost::multiprecision::number, false>()); #endif } diff --git a/test/concepts/sf_concept_check_gamma.cpp b/test/concepts/sf_concept_check_gamma.cpp index bd108e9a..2dcdcaf8 100644 --- a/test/concepts/sf_concept_check_gamma.cpp +++ b/test/concepts/sf_concept_check_gamma.cpp @@ -111,22 +111,22 @@ void foo() test_extra(boost::multiprecision::mpfr_float_50()); #endif #ifdef TEST_MPFR_6 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_15 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_17 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_30 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_CPP_DEC_FLOAT test_extra(boost::multiprecision::cpp_dec_float_50()); #endif #ifdef TEST_CPP_DEC_FLOAT_NO_ET - test_extra(boost::multiprecision::mp_number, false>()); + test_extra(boost::multiprecision::number, false>()); #endif } diff --git a/test/concepts/sf_concept_check_poly.cpp b/test/concepts/sf_concept_check_poly.cpp index d8e855e2..fff337e9 100644 --- a/test/concepts/sf_concept_check_poly.cpp +++ b/test/concepts/sf_concept_check_poly.cpp @@ -86,22 +86,22 @@ void foo() test_extra(boost::multiprecision::mpfr_float_50()); #endif #ifdef TEST_MPFR_6 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_15 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_17 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_MPFR_30 - test_extra(boost::multiprecision::mp_number >()); + test_extra(boost::multiprecision::number >()); #endif #ifdef TEST_CPP_DEC_FLOAT test_extra(boost::multiprecision::cpp_dec_float_50()); #endif #ifdef TEST_CPP_DEC_FLOAT_NO_ET - test_extra(boost::multiprecision::mp_number, false>()); + test_extra(boost::multiprecision::number, false>()); #endif } diff --git a/test/include_test/cpp_int_include_test.cpp b/test/include_test/cpp_int_include_test.cpp index f193178c..7e665657 100644 --- a/test/include_test/cpp_int_include_test.cpp +++ b/test/include_test/cpp_int_include_test.cpp @@ -7,10 +7,10 @@ using namespace boost::multiprecision; -mp_number > a; -mp_number, false> b; -mp_number, false> c; -mp_number, false> d; -mp_number, false> e; +number > a; +number, false> b; +number, false> c; +number, false> d; +number, false> e; diff --git a/test/math/log1p_expm1_test.cpp b/test/math/log1p_expm1_test.cpp index 9b9867aa..1754094c 100644 --- a/test/math/log1p_expm1_test.cpp +++ b/test/math/log1p_expm1_test.cpp @@ -128,19 +128,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test(mp_number >(), "mp_number >"); - test(mp_number >(), "mp_number >"); - test(mp_number >(), "mp_number >"); + test(number >(), "number >"); + test(number >(), "number >"); + test(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test(mp_number >(), "mp_number >"); - test(mp_number >(), "mp_number >"); - test(mp_number >(), "mp_number >"); + test(number >(), "number >"); + test(number >(), "number >"); + test(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test(mp_number >(), "mp_number >"); - test(mp_number >(), "mp_number >"); - test(mp_number >(), "mp_number >"); + test(number >(), "number >"); + test(number >(), "number >"); + test(number >(), "number >"); #endif return 0; } diff --git a/test/math/powm1_sqrtp1m1_test.cpp b/test/math/powm1_sqrtp1m1_test.cpp index 56bdd600..c3853651 100644 --- a/test/math/powm1_sqrtp1m1_test.cpp +++ b/test/math/powm1_sqrtp1m1_test.cpp @@ -120,19 +120,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - maybe in std::exp?? Disabled for now. - //test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); + //test_powm1_sqrtp1m1(number >(), "number >"); + test_powm1_sqrtp1m1(number >(), "number >"); + test_powm1_sqrtp1m1(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); + test_powm1_sqrtp1m1(number >(), "number >"); + test_powm1_sqrtp1m1(number >(), "number >"); + test_powm1_sqrtp1m1(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); - test_powm1_sqrtp1m1(mp_number >(), "mp_number >"); + test_powm1_sqrtp1m1(number >(), "number >"); + test_powm1_sqrtp1m1(number >(), "number >"); + test_powm1_sqrtp1m1(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_bessel_i.cpp b/test/math/test_bessel_i.cpp index 4e94c24a..3532f397 100644 --- a/test/math/test_bessel_i.cpp +++ b/test/math/test_bessel_i.cpp @@ -88,20 +88,20 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - maybe in std::exp?? Disabled for now. - //test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + //test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_bessel_j.cpp b/test/math/test_bessel_j.cpp index 951a6821..931422aa 100644 --- a/test/math/test_bessel_j.cpp +++ b/test/math/test_bessel_j.cpp @@ -130,19 +130,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - maybe in std::exp?? Disabled for now. - //test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + //test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_bessel_k.cpp b/test/math/test_bessel_k.cpp index 044fc49a..856180e9 100644 --- a/test/math/test_bessel_k.cpp +++ b/test/math/test_bessel_k.cpp @@ -103,19 +103,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - maybe in std::exp?? Disabled for now. - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_bessel_y.cpp b/test/math/test_bessel_y.cpp index 44d23126..dd9c99dd 100644 --- a/test/math/test_bessel_y.cpp +++ b/test/math/test_bessel_y.cpp @@ -129,19 +129,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - our argument reduction in std::sin isn't accurate enough: - //test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + //test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); - test_bessel(mp_number >(), "mp_number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); + test_bessel(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_beta.cpp b/test/math/test_beta.cpp index 49541cd8..b69c1808 100644 --- a/test/math/test_beta.cpp +++ b/test/math/test_beta.cpp @@ -115,19 +115,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - our argument reduction in std::sin isn't accurate enough: - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_binomial_coeff.cpp b/test/math/test_binomial_coeff.cpp index 0d9bf414..146b1af2 100644 --- a/test/math/test_binomial_coeff.cpp +++ b/test/math/test_binomial_coeff.cpp @@ -94,19 +94,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - our argument reduction in std::sin isn't accurate enough: - test_binomial(mp_number >(), "mp_number >"); - test_binomial(mp_number >(), "mp_number >"); - test_binomial(mp_number >(), "mp_number >"); + test_binomial(number >(), "number >"); + test_binomial(number >(), "number >"); + test_binomial(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_binomial(mp_number >(), "mp_number >"); - test_binomial(mp_number >(), "mp_number >"); - test_binomial(mp_number >(), "mp_number >"); + test_binomial(number >(), "number >"); + test_binomial(number >(), "number >"); + test_binomial(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_binomial(mp_number >(), "mp_number >"); - test_binomial(mp_number >(), "mp_number >"); - test_binomial(mp_number >(), "mp_number >"); + test_binomial(number >(), "number >"); + test_binomial(number >(), "number >"); + test_binomial(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_carlson.cpp b/test/math/test_carlson.cpp index e0a9e3c8..1aacc108 100644 --- a/test/math/test_carlson.cpp +++ b/test/math/test_carlson.cpp @@ -86,19 +86,19 @@ int test_main(int, char* []) // #ifdef TEST_MPF_50 // We have accuracy issues with gmp_float<18> - our argument reduction in std::sin isn't accurate enough: - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_cbrt.cpp b/test/math/test_cbrt.cpp index e7bee00c..b896d6d7 100644 --- a/test/math/test_cbrt.cpp +++ b/test/math/test_cbrt.cpp @@ -75,19 +75,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_cbrt(mp_number >(), "mp_number >"); - test_cbrt(mp_number >(), "mp_number >"); - test_cbrt(mp_number >(), "mp_number >"); + test_cbrt(number >(), "number >"); + test_cbrt(number >(), "number >"); + test_cbrt(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_cbrt(mp_number >(), "mp_number >"); - test_cbrt(mp_number >(), "mp_number >"); - test_cbrt(mp_number >(), "mp_number >"); + test_cbrt(number >(), "number >"); + test_cbrt(number >(), "number >"); + test_cbrt(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_cbrt(mp_number >(), "mp_number >"); - test_cbrt(mp_number >(), "mp_number >"); - test_cbrt(mp_number >(), "mp_number >"); + test_cbrt(number >(), "number >"); + test_cbrt(number >(), "number >"); + test_cbrt(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_digamma.cpp b/test/math/test_digamma.cpp index 8da4bd53..2d18eaa6 100644 --- a/test/math/test_digamma.cpp +++ b/test/math/test_digamma.cpp @@ -89,19 +89,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_digamma(mp_number >(), "mp_number >"); - test_digamma(mp_number >(), "mp_number >"); - test_digamma(mp_number >(), "mp_number >"); + test_digamma(number >(), "number >"); + test_digamma(number >(), "number >"); + test_digamma(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_digamma(mp_number >(), "mp_number >"); - test_digamma(mp_number >(), "mp_number >"); - test_digamma(mp_number >(), "mp_number >"); + test_digamma(number >(), "number >"); + test_digamma(number >(), "number >"); + test_digamma(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_digamma(mp_number >(), "mp_number >"); - test_digamma(mp_number >(), "mp_number >"); - test_digamma(mp_number >(), "mp_number >"); + test_digamma(number >(), "number >"); + test_digamma(number >(), "number >"); + test_digamma(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ellint_1.cpp b/test/math/test_ellint_1.cpp index 356653d0..c7da569a 100644 --- a/test/math/test_ellint_1.cpp +++ b/test/math/test_ellint_1.cpp @@ -82,19 +82,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ellint_2.cpp b/test/math/test_ellint_2.cpp index a8cbfca5..c07bddac 100644 --- a/test/math/test_ellint_2.cpp +++ b/test/math/test_ellint_2.cpp @@ -75,19 +75,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ellint_3.cpp b/test/math/test_ellint_3.cpp index c57ddfec..9d3d6904 100644 --- a/test/math/test_ellint_3.cpp +++ b/test/math/test_ellint_3.cpp @@ -96,19 +96,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); - test_spots(mp_number >(), "mp_number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); + test_spots(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_erf.cpp b/test/math/test_erf.cpp index b185c3cd..1b77e3a4 100644 --- a/test/math/test_erf.cpp +++ b/test/math/test_erf.cpp @@ -96,19 +96,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_erf(mp_number >(), "mp_number >"); - test_erf(mp_number >(), "mp_number >"); - test_erf(mp_number >(), "mp_number >"); + test_erf(number >(), "number >"); + test_erf(number >(), "number >"); + test_erf(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_erf(mp_number >(), "mp_number >"); - test_erf(mp_number >(), "mp_number >"); - test_erf(mp_number >(), "mp_number >"); + test_erf(number >(), "number >"); + test_erf(number >(), "number >"); + test_erf(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_erf(mp_number >(), "mp_number >"); - test_erf(mp_number >(), "mp_number >"); - test_erf(mp_number >(), "mp_number >"); + test_erf(number >(), "number >"); + test_erf(number >(), "number >"); + test_erf(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_expint.cpp b/test/math/test_expint.cpp index 71961792..0dbffc58 100644 --- a/test/math/test_expint.cpp +++ b/test/math/test_expint.cpp @@ -96,19 +96,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_expint(mp_number >(), "mp_number >"); - test_expint(mp_number >(), "mp_number >"); - test_expint(mp_number >(), "mp_number >"); + test_expint(number >(), "number >"); + test_expint(number >(), "number >"); + test_expint(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_expint(mp_number >(), "mp_number >"); - test_expint(mp_number >(), "mp_number >"); - test_expint(mp_number >(), "mp_number >"); + test_expint(number >(), "number >"); + test_expint(number >(), "number >"); + test_expint(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_expint(mp_number >(), "mp_number >"); - test_expint(mp_number >(), "mp_number >"); - test_expint(mp_number >(), "mp_number >"); + test_expint(number >(), "number >"); + test_expint(number >(), "number >"); + test_expint(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_gamma.cpp b/test/math/test_gamma.cpp index c7511413..44ca68be 100644 --- a/test/math/test_gamma.cpp +++ b/test/math/test_gamma.cpp @@ -110,19 +110,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_hermite.cpp b/test/math/test_hermite.cpp index be956ce1..271b8138 100644 --- a/test/math/test_hermite.cpp +++ b/test/math/test_hermite.cpp @@ -75,19 +75,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_hermite(mp_number >(), "mp_number >"); - test_hermite(mp_number >(), "mp_number >"); - test_hermite(mp_number >(), "mp_number >"); + test_hermite(number >(), "number >"); + test_hermite(number >(), "number >"); + test_hermite(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_hermite(mp_number >(), "mp_number >"); - test_hermite(mp_number >(), "mp_number >"); - test_hermite(mp_number >(), "mp_number >"); + test_hermite(number >(), "number >"); + test_hermite(number >(), "number >"); + test_hermite(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_hermite(mp_number >(), "mp_number >"); - test_hermite(mp_number >(), "mp_number >"); - test_hermite(mp_number >(), "mp_number >"); + test_hermite(number >(), "number >"); + test_hermite(number >(), "number >"); + test_hermite(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ibeta.cpp b/test/math/test_ibeta.cpp index dde145f8..b78358f2 100644 --- a/test/math/test_ibeta.cpp +++ b/test/math/test_ibeta.cpp @@ -106,19 +106,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ibeta_2.cpp b/test/math/test_ibeta_2.cpp index c7cb04fc..7dcc2fd8 100644 --- a/test/math/test_ibeta_2.cpp +++ b/test/math/test_ibeta_2.cpp @@ -106,19 +106,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ibeta_3.cpp b/test/math/test_ibeta_3.cpp index 77b69d78..d1f0d132 100644 --- a/test/math/test_ibeta_3.cpp +++ b/test/math/test_ibeta_3.cpp @@ -92,19 +92,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ibeta_4.cpp b/test/math/test_ibeta_4.cpp index 5f3246fd..f71c117f 100644 --- a/test/math/test_ibeta_4.cpp +++ b/test/math/test_ibeta_4.cpp @@ -99,19 +99,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ibeta_inv_1.cpp b/test/math/test_ibeta_inv_1.cpp index 2492b7ac..88fc6184 100644 --- a/test/math/test_ibeta_inv_1.cpp +++ b/test/math/test_ibeta_inv_1.cpp @@ -85,19 +85,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - //test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + //test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_ibeta_inv_ab_4.cpp b/test/math/test_ibeta_inv_ab_4.cpp index 67c4c588..e00fb612 100644 --- a/test/math/test_ibeta_inv_ab_4.cpp +++ b/test/math/test_ibeta_inv_ab_4.cpp @@ -78,19 +78,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - //test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + //test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); - test_beta(mp_number >(), "mp_number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); + test_beta(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_igamma.cpp b/test/math/test_igamma.cpp index 66aa9011..429f1f40 100644 --- a/test/math/test_igamma.cpp +++ b/test/math/test_igamma.cpp @@ -82,19 +82,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_igamma_inv.cpp b/test/math/test_igamma_inv.cpp index 3a0d76cc..1bf31054 100644 --- a/test/math/test_igamma_inv.cpp +++ b/test/math/test_igamma_inv.cpp @@ -97,19 +97,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_igamma_inva.cpp b/test/math/test_igamma_inva.cpp index 026694c8..09633434 100644 --- a/test/math/test_igamma_inva.cpp +++ b/test/math/test_igamma_inva.cpp @@ -76,19 +76,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); - test_gamma(mp_number >(), "mp_number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); + test_gamma(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_laguerre.cpp b/test/math/test_laguerre.cpp index f3cded2a..fe309c88 100644 --- a/test/math/test_laguerre.cpp +++ b/test/math/test_laguerre.cpp @@ -75,19 +75,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_laguerre(mp_number >(), "mp_number >"); - test_laguerre(mp_number >(), "mp_number >"); - test_laguerre(mp_number >(), "mp_number >"); + test_laguerre(number >(), "number >"); + test_laguerre(number >(), "number >"); + test_laguerre(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_laguerre(mp_number >(), "mp_number >"); - test_laguerre(mp_number >(), "mp_number >"); - test_laguerre(mp_number >(), "mp_number >"); + test_laguerre(number >(), "number >"); + test_laguerre(number >(), "number >"); + test_laguerre(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_laguerre(mp_number >(), "mp_number >"); - test_laguerre(mp_number >(), "mp_number >"); - test_laguerre(mp_number >(), "mp_number >"); + test_laguerre(number >(), "number >"); + test_laguerre(number >(), "number >"); + test_laguerre(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_legendre.cpp b/test/math/test_legendre.cpp index e392365f..e3b26c51 100644 --- a/test/math/test_legendre.cpp +++ b/test/math/test_legendre.cpp @@ -75,19 +75,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_legendre_p(mp_number >(), "mp_number >"); - test_legendre_p(mp_number >(), "mp_number >"); - test_legendre_p(mp_number >(), "mp_number >"); + test_legendre_p(number >(), "number >"); + test_legendre_p(number >(), "number >"); + test_legendre_p(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_legendre_p(mp_number >(), "mp_number >"); - test_legendre_p(mp_number >(), "mp_number >"); - test_legendre_p(mp_number >(), "mp_number >"); + test_legendre_p(number >(), "number >"); + test_legendre_p(number >(), "number >"); + test_legendre_p(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_legendre_p(mp_number >(), "mp_number >"); - test_legendre_p(mp_number >(), "mp_number >"); - test_legendre_p(mp_number >(), "mp_number >"); + test_legendre_p(number >(), "number >"); + test_legendre_p(number >(), "number >"); + test_legendre_p(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_tgamma_ratio.cpp b/test/math/test_tgamma_ratio.cpp index 982546bd..7657e325 100644 --- a/test/math/test_tgamma_ratio.cpp +++ b/test/math/test_tgamma_ratio.cpp @@ -89,19 +89,19 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_tgamma_ratio(mp_number >(), "mp_number >"); - test_tgamma_ratio(mp_number >(), "mp_number >"); - test_tgamma_ratio(mp_number >(), "mp_number >"); + test_tgamma_ratio(number >(), "number >"); + test_tgamma_ratio(number >(), "number >"); + test_tgamma_ratio(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_tgamma_ratio(mp_number >(), "mp_number >"); - test_tgamma_ratio(mp_number >(), "mp_number >"); - test_tgamma_ratio(mp_number >(), "mp_number >"); + test_tgamma_ratio(number >(), "number >"); + test_tgamma_ratio(number >(), "number >"); + test_tgamma_ratio(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_tgamma_ratio(mp_number >(), "mp_number >"); - test_tgamma_ratio(mp_number >(), "mp_number >"); - test_tgamma_ratio(mp_number >(), "mp_number >"); + test_tgamma_ratio(number >(), "number >"); + test_tgamma_ratio(number >(), "number >"); + test_tgamma_ratio(number >(), "number >"); #endif return 0; } diff --git a/test/math/test_zeta.cpp b/test/math/test_zeta.cpp index 4484a7d3..0c7976cd 100644 --- a/test/math/test_zeta.cpp +++ b/test/math/test_zeta.cpp @@ -83,20 +83,20 @@ int test_main(int, char* []) // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); #endif #ifdef TEST_MPFR_50 - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); #endif #ifdef TEST_CPP_DEC_FLOAT - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); - test_zeta(mp_number >(), "mp_number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); + test_zeta(number >(), "number >"); #endif return 0; } diff --git a/test/test_acos.cpp b/test/test_acos.cpp index 6e81985f..b4dcc828 100644 --- a/test/test_acos.cpp +++ b/test/test_acos.cpp @@ -89,7 +89,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -103,14 +103,14 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_arithmetic.cpp b/test/test_arithmetic.cpp index fad3dbb3..71e49d19 100644 --- a/test/test_arithmetic.cpp +++ b/test/test_arithmetic.cpp @@ -1211,12 +1211,12 @@ void test() int main() { #ifdef TEST_ARITHMETIC_BACKEND - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); #endif #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -1228,14 +1228,14 @@ int main() #endif #ifdef TEST_MPZ test(); - test > >(); + test > >(); #endif #ifdef TEST_MPQ test(); #endif #ifdef TEST_CPP_DEC_FLOAT test(); - test, false> >(); + test, false> >(); #endif #ifdef TEST_MPFR test(); @@ -1245,7 +1245,7 @@ int main() #endif #ifdef TEST_TOMMATH test(); - test > >(); + test > >(); #endif #ifdef TEST_TOMMATH_BOOST_RATIONAL test >(); @@ -1255,15 +1255,15 @@ int main() #endif #ifdef TEST_CPP_INT test(); - test(); - test(); + test(); + test(); test(); - test, false> >(); - test > >(); + test, false> >(); + test > >(); // Again with "trivial" backends: - test, false > >(); - test, false > >(); + test, false > >(); + test, false > >(); #endif #ifdef TEST_CPP_INT_BR test(); diff --git a/test/test_asin.cpp b/test/test_asin.cpp index 61ab5d12..271172fe 100644 --- a/test/test_asin.cpp +++ b/test/test_asin.cpp @@ -85,7 +85,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -99,17 +99,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_atan.cpp b/test/test_atan.cpp index de426780..1b28a395 100644 --- a/test/test_atan.cpp +++ b/test/test_atan.cpp @@ -62,7 +62,7 @@ struct is_mpfr_type : public boost::mpl::false_ {}; #ifdef TEST_MPFR_50 template -struct is_mpfr_type > > : public boost::mpl::true_{}; +struct is_mpfr_type > > : public boost::mpl::true_{}; #endif template @@ -231,7 +231,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -245,17 +245,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_constants.cpp b/test/test_constants.cpp index 5e9ad8e7..4e72ca11 100644 --- a/test/test_constants.cpp +++ b/test/test_constants.cpp @@ -160,7 +160,7 @@ inline bool is_mpfr(const T&) } #if defined(TEST_MPFR_50) template -inline bool is_mpfr(const boost::multiprecision::mp_number >&) +inline bool is_mpfr(const boost::multiprecision::number >&) { return true; } @@ -185,13 +185,13 @@ void test() int main() { #ifdef TEST_MPFR_50 - test > >(); + test > >(); #endif #ifdef TEST_CPP_DEC_FLOAT - test > >(); + test > >(); #endif #ifdef TEST_MPF_50 - test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_constexpr.cpp b/test/test_constexpr.cpp index 6e97e2ae..66e601b1 100644 --- a/test/test_constexpr.cpp +++ b/test/test_constexpr.cpp @@ -31,9 +31,9 @@ void test3() using namespace boost::multiprecision; -template void test1, false> >(); -template void test1, false> >(); -template void test3, false> >(); -template void test2, false> >(); +template void test1, false> >(); +template void test1, false> >(); +template void test3, false> >(); +template void test2, false> >(); #endif \ No newline at end of file diff --git a/test/test_cos.cpp b/test/test_cos.cpp index b31528bf..36488b1b 100644 --- a/test/test_cos.cpp +++ b/test/test_cos.cpp @@ -285,7 +285,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -299,14 +299,14 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_cosh.cpp b/test/test_cosh.cpp index ada92a21..46900c40 100644 --- a/test/test_cosh.cpp +++ b/test/test_cosh.cpp @@ -127,7 +127,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -141,14 +141,14 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_cpp_int.cpp b/test/test_cpp_int.cpp index a21f2a8b..9efa78a3 100644 --- a/test/test_cpp_int.cpp +++ b/test/test_cpp_int.cpp @@ -340,7 +340,7 @@ int main() { using namespace boost::multiprecision; test(); - test > >(); + test > >(); return boost::report_errors(); } diff --git a/test/test_exp.cpp b/test/test_exp.cpp index da5cceff..4167d4c7 100644 --- a/test/test_exp.cpp +++ b/test/test_exp.cpp @@ -167,7 +167,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -181,17 +181,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_fixed_int.cpp b/test/test_fixed_int.cpp index e69e2e29..87a72399 100644 --- a/test/test_fixed_int.cpp +++ b/test/test_fixed_int.cpp @@ -54,7 +54,7 @@ T generate_random(unsigned bits_wanted) int main() { using namespace boost::multiprecision; - typedef mp_number > packed_type; + typedef number > packed_type; unsigned last_error_count = 0; for(int i = 0; i < 1000; ++i) { diff --git a/test/test_float_io.cpp b/test/test_float_io.cpp index fb51eede..410b531a 100644 --- a/test/test_float_io.cpp +++ b/test/test_float_io.cpp @@ -42,7 +42,7 @@ #if defined(TEST_MPF_50) template -bool is_mpf(const boost::multiprecision::mp_number >&) +bool is_mpf(const boost::multiprecision::number >&) { return true; } #endif template @@ -215,23 +215,23 @@ struct max_digits10_proxy }; #ifdef TEST_CPP_DEC_FLOAT template -struct max_digits10_proxy, ET> > +struct max_digits10_proxy, ET> > { - static const unsigned value = std::numeric_limits, ET> >::max_digits10; + static const unsigned value = std::numeric_limits, ET> >::max_digits10; }; #endif #ifdef TEST_MPF_50 template -struct max_digits10_proxy, ET> > +struct max_digits10_proxy, ET> > { - static const unsigned value = std::numeric_limits, ET> >::max_digits10; + static const unsigned value = std::numeric_limits, ET> >::max_digits10; }; #endif #ifdef TEST_MPFR_50 template -struct max_digits10_proxy, ET> > +struct max_digits10_proxy, ET> > { - static const unsigned value = std::numeric_limits, ET> >::max_digits10; + static const unsigned value = std::numeric_limits, ET> >::max_digits10; }; #endif diff --git a/test/test_fpclassify.cpp b/test/test_fpclassify.cpp index 063ba8a9..b579daca 100644 --- a/test/test_fpclassify.cpp +++ b/test/test_fpclassify.cpp @@ -314,7 +314,7 @@ int main() test(); #endif #ifdef TEST_BACKEND - test >(); + test >(); #endif return boost::report_errors(); } diff --git a/test/test_generic_conv.cpp b/test/test_generic_conv.cpp index df033f83..a552a3cd 100644 --- a/test/test_generic_conv.cpp +++ b/test/test_generic_conv.cpp @@ -58,7 +58,7 @@ int main() // // Now integer to float: // - typedef mp_number > dec_float_500; + typedef number > dec_float_500; dec_float_500 df(c); dec_float_500 df2(c.str()); BOOST_CHECK_EQUAL(df, df2); @@ -66,7 +66,7 @@ int main() df2 = -df2; BOOST_CHECK_EQUAL(df, df2); #ifdef TEST_GMP - typedef mp_number > mpf_type; + typedef number > mpf_type; mpf_type mpf(c); mpf_type mpf2(c.str()); BOOST_CHECK_EQUAL(mpf, mpf2); @@ -75,7 +75,7 @@ int main() BOOST_CHECK_EQUAL(mpf, mpf2); #endif #ifdef TEST_MPFR - typedef mp_number > mpfr_type; + typedef number > mpfr_type; mpfr_type mpfr(c); mpfr_type mpfr2(c.str()); BOOST_CHECK_EQUAL(mpfr, mpfr2); diff --git a/test/test_int_io.cpp b/test/test_int_io.cpp index 87c79ec7..1f87a88c 100644 --- a/test/test_int_io.cpp +++ b/test/test_int_io.cpp @@ -123,9 +123,9 @@ int main() test_round_trip(); #endif #ifdef TEST_CPP_INT - test_round_trip > >(); - test_round_trip > >(); - test_round_trip > >(); + test_round_trip > >(); + test_round_trip > >(); + test_round_trip > >(); #endif return boost::report_errors(); } diff --git a/test/test_log.cpp b/test/test_log.cpp index 35714bc0..1d5f0342 100644 --- a/test/test_log.cpp +++ b/test/test_log.cpp @@ -195,7 +195,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -209,17 +209,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_numeric_limits.cpp b/test/test_numeric_limits.cpp index 20ad2dad..6d5c376d 100644 --- a/test/test_numeric_limits.cpp +++ b/test/test_numeric_limits.cpp @@ -201,7 +201,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -237,10 +237,10 @@ int main() #endif #ifdef TEST_CPP_INT test(); - test(); - test(); - test > >(); - test > >(); + test(); + test(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_pow.cpp b/test/test_pow.cpp index 4c55ab07..49762f90 100644 --- a/test/test_pow.cpp +++ b/test/test_pow.cpp @@ -570,7 +570,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -584,17 +584,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_rational_io.cpp b/test/test_rational_io.cpp index 4d629fb7..8003d4f3 100644 --- a/test/test_rational_io.cpp +++ b/test/test_rational_io.cpp @@ -92,7 +92,7 @@ void do_round_trip(const T& val, std::ios_base::fmtflags f, const boost::mpl::fa template struct is_mp_number : public boost::mpl::false_{}; template -struct is_mp_number > : public boost::mpl::true_{}; +struct is_mp_number > : public boost::mpl::true_{}; template void do_round_trip(const T& val, std::ios_base::fmtflags f) @@ -127,7 +127,7 @@ int main() #ifdef TEST_MPQ test_round_trip(); test_round_trip >(); - test_round_trip > >(); + test_round_trip > >(); #endif #ifdef TEST_TOMMATH test_round_trip >(); diff --git a/test/test_round.cpp b/test/test_round.cpp index 1fb4822d..d77f24be 100644 --- a/test/test_round.cpp +++ b/test/test_round.cpp @@ -390,17 +390,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); #endif #ifdef TEST_BACKEND - test >(); + test >(); #endif return boost::report_errors(); } diff --git a/test/test_sin.cpp b/test/test_sin.cpp index f8ad7830..fef86827 100644 --- a/test/test_sin.cpp +++ b/test/test_sin.cpp @@ -279,7 +279,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -293,17 +293,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_sinh.cpp b/test/test_sinh.cpp index b4fc7194..2a18c8b5 100644 --- a/test/test_sinh.cpp +++ b/test/test_sinh.cpp @@ -203,7 +203,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -217,17 +217,17 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_sqrt.cpp b/test/test_sqrt.cpp index da17ea4c..57b84206 100644 --- a/test/test_sqrt.cpp +++ b/test/test_sqrt.cpp @@ -173,7 +173,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -187,20 +187,20 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); // Check low multiprecision digit counts. - test > >(); - test > >(); + test > >(); + test > >(); // Check up to 1000 multiprecision digits. - test > >(); - test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/test_tanh.cpp b/test/test_tanh.cpp index d4f57038..a76fbe48 100644 --- a/test/test_tanh.cpp +++ b/test/test_tanh.cpp @@ -122,7 +122,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF_50 test(); @@ -136,14 +136,14 @@ int main() test(); test(); // Some "peculiar" digit counts which stress our code: - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); - test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); + test > >(); #endif return boost::report_errors(); } diff --git a/test/ublas_interop/test1.hpp b/test/ublas_interop/test1.hpp index 9d0731cb..db44c15f 100644 --- a/test/ublas_interop/test1.hpp +++ b/test/ublas_interop/test1.hpp @@ -19,7 +19,7 @@ #include -typedef boost::multiprecision::mp_number, false> mp_test_type; +typedef boost::multiprecision::number, false> mp_test_type; //typedef double mp_test_type; #define USE_RANGE diff --git a/test/ublas_interop/test2.hpp b/test/ublas_interop/test2.hpp index b58c6177..8dfc0a61 100644 --- a/test/ublas_interop/test2.hpp +++ b/test/ublas_interop/test2.hpp @@ -18,7 +18,7 @@ #include -typedef boost::multiprecision::mp_number, false> mp_test_type; +typedef boost::multiprecision::number, false> mp_test_type; //typedef double mp_test_type; #define USE_RANGE diff --git a/test/ublas_interop/test3.hpp b/test/ublas_interop/test3.hpp index 032b029c..e884d80c 100644 --- a/test/ublas_interop/test3.hpp +++ b/test/ublas_interop/test3.hpp @@ -19,7 +19,7 @@ #include -typedef boost::multiprecision::mp_number, false> mp_test_type; +typedef boost::multiprecision::number, false> mp_test_type; //typedef double mp_test_type; #define USE_RANGE diff --git a/test/ublas_interop/test4.hpp b/test/ublas_interop/test4.hpp index 20194f7a..6001e9c4 100644 --- a/test/ublas_interop/test4.hpp +++ b/test/ublas_interop/test4.hpp @@ -19,7 +19,7 @@ #include -typedef boost::multiprecision::mp_number, false> mp_test_type; +typedef boost::multiprecision::number, false> mp_test_type; //typedef double mp_test_type; #define USE_RANGE diff --git a/test/ublas_interop/test5.hpp b/test/ublas_interop/test5.hpp index cd98e665..639cecaf 100644 --- a/test/ublas_interop/test5.hpp +++ b/test/ublas_interop/test5.hpp @@ -19,7 +19,7 @@ #include -typedef boost::multiprecision::mp_number, false> mp_test_type; +typedef boost::multiprecision::number, false> mp_test_type; //typedef double mp_test_type; #define USE_RANGE diff --git a/test/ublas_interop/test7.hpp b/test/ublas_interop/test7.hpp index 4990642f..40546991 100644 --- a/test/ublas_interop/test7.hpp +++ b/test/ublas_interop/test7.hpp @@ -19,7 +19,7 @@ #include -typedef boost::multiprecision::mp_number, false> mp_test_type; +typedef boost::multiprecision::number, false> mp_test_type; //typedef double mp_test_type; #define USE_RANGE