Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54411 - in sandbox/mp_math: boost/mp_math/integer libs/mp_math/test/gmp_integer
From: baraclese_at_[hidden]
Date: 2009-06-27 12:09:34


Author: baraclese
Date: 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
New Revision: 54411
URL: http://svn.boost.org/trac/boost/changeset/54411

Log:
* gmp_integer.hpp: fix comparison against integral types
* add gmp_integer tests
* libtom_integer.hpp: remove comment that refers to GMP

Added:
   sandbox/mp_math/libs/mp_math/test/gmp_integer/
   sandbox/mp_math/libs/mp_math/test/gmp_integer/abs.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/add.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/assign.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/bool_conversion.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/cmp.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/gcd.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/jacobi.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/lcm.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/modinv.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/modpow.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/mul.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/pow.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/shift.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/sqr.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/sub.cpp (contents, props changed)
   sandbox/mp_math/libs/mp_math/test/gmp_integer/swap.cpp (contents, props changed)
Text files modified:
   sandbox/mp_math/boost/mp_math/integer/gmp_integer.hpp | 8 ++++----
   sandbox/mp_math/boost/mp_math/integer/libtom_integer.hpp | 2 --
   2 files changed, 4 insertions(+), 6 deletions(-)

Modified: sandbox/mp_math/boost/mp_math/integer/gmp_integer.hpp
==============================================================================
--- sandbox/mp_math/boost/mp_math/integer/gmp_integer.hpp (original)
+++ sandbox/mp_math/boost/mp_math/integer/gmp_integer.hpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -1014,12 +1014,12 @@
 }
 
 // compare unbounded_int to integral
-/*template<class B, typename IntegralT>
+template<class B, typename IntegralT>
 inline
 typename enable_if<is_integral<IntegralT>, bool>::type
 operator == (const gmp_integer<B>& lhs, IntegralT rhs)
 {
- return detail::unbounded_int_integral_ops<
+ return detail::gmp_integer_integral_ops<
     gmp_integer<B>, IntegralT>::equal(lhs, rhs);
 }
 
@@ -1036,7 +1036,7 @@
 typename enable_if<is_integral<IntegralT>, bool>::type
 operator < (const gmp_integer<B>& lhs, IntegralT rhs)
 {
- return detail::unbounded_int_integral_ops<
+ return detail::gmp_integer_integral_ops<
     gmp_integer<B>, IntegralT>::less(lhs, rhs);
 }
 
@@ -1111,7 +1111,7 @@
 operator >= (IntegralT lhs, const gmp_integer<B>& rhs)
 {
   return rhs <= lhs;
-}*/
+}
 
 // compare unbounded_int to const charT*
 template<class B, typename charT>

Modified: sandbox/mp_math/boost/mp_math/integer/libtom_integer.hpp
==============================================================================
--- sandbox/mp_math/boost/mp_math/integer/libtom_integer.hpp (original)
+++ sandbox/mp_math/boost/mp_math/integer/libtom_integer.hpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -230,8 +230,6 @@
 };
 
 
-// Same as libtom_allocated_string in libtom-impl.h, but we can't use it because
-// libtom-impl.h is an internal GMP header and is probably not installed.
 extern "C"
 {
   typedef void (*libtom_free_func)(void *, size_t);

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/abs.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/abs.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,15 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(abs1, int_type, IntTypes)
+{
+ const int_type x("-0x123abdddfe4983");
+ const int_type y = boost::mp_math::abs(x);
+ BOOST_CHECK_EQUAL(y, "0x123abdddfe4983");
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/add.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/add.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,245 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_assign1, int_type, IntTypes)
+{
+ int_type x("0xffffffff");
+ const int_type y("0xffffffffffffffff");
+ x += y;
+ BOOST_CHECK_EQUAL(x, "0x100000000fffffffe");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_positive_numbers1, int_type, IntTypes)
+{
+ const int_type x("123456");
+ const int_type y("987777");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "1111233");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_positive_numbers2, int_type, IntTypes)
+{
+ const int_type x("999");
+ const int_type y("123456");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "124455");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_positive_numbers3, int_type, IntTypes)
+{
+ const int_type x("21474836470");
+ const int_type y("1234567845600");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "1256042682070");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_positive_numbers4, int_type, IntTypes)
+{
+ const int_type x("0xffffffffffffffff");
+ const int_type y("0xffffffffffffffff");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "0x1fffffffffffffffe");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_positive_numbers5, int_type, IntTypes)
+{
+ const int_type x("0xffffffffffffffff");
+ const int_type y("0xffffffff");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "0x100000000fffffffe");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_negative_numbers1, int_type, IntTypes)
+{
+ const int_type x("-123456");
+ const int_type y("-987777");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "-1111233");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_negative_numbers2, int_type, IntTypes)
+{
+ const int_type x("-12345678900000000");
+ const int_type y("-987777");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "-12345678900987777");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_negative_numbers3, int_type, IntTypes)
+{
+ const int_type x("-987777");
+ const int_type y("-12345678900000000");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "-12345678900987777");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_mixed_numbers1, int_type, IntTypes)
+{
+ const int_type x("-123456");
+ const int_type y("987777");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "864321");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_mixed_numbers2, int_type, IntTypes)
+{
+ const int_type x("123456");
+ const int_type y("-987777");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "-864321");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_mixed_numbers3, int_type, IntTypes)
+{
+ const int_type x("-123456");
+ const int_type y("123456");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_mixed_numbers4, int_type, IntTypes)
+{
+ const int_type x("123456");
+ const int_type y("-123456");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_mixed_numbers5, int_type, IntTypes)
+{
+ const int_type x("1000");
+ const int_type y("-12345678901000");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "-12345678900000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_mixed_numbers6, int_type, IntTypes)
+{
+ const int_type x("-12345678901000");
+ const int_type y("1000");
+ const int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "-12345678900000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_large_and_small, int_type, IntTypes)
+{
+ int_type x("123456789");
+ int_type y("123");
+ int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "123456912");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_small_and_large, int_type, IntTypes)
+{
+ int_type x("123");
+ int_type y("123456789");
+ int_type z = x + y;
+ BOOST_CHECK_EQUAL(z, "123456912");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(add_large_and_large, int_type, IntTypes)
+{
+ int_type x(
+ "76563204409879018101322737668344063995824904757312285775560614771886933079"
+ "77822556905976720912850551355328340715074887289899094852653102687850101285"
+ "85715275531977696497398396067715769512450915961775500023723324150851793075"
+ "51871751151095323159497918186624088118225730504044262785072662119470825604"
+ "40835072257208973943520251201155002832786969323087571220195329601804141972"
+ "71293425859967733061169954398382700046379970842289727254846347411792122453"
+ "98890529530611217475343335863666953662801553948341581412563112340543629531"
+ "01094529771464590172847457807673685591148055046712881378811934516545088775"
+ "38198087116656466935095055228728162461388333618793883566996616940381738437"
+ "03453867953392241443573580380271627517797446062394044787118140775664622031"
+ "49144609407766890328547643707523663509662747376486271392344480900673178645"
+ "33198519112197059826509662943577383543858946941049753393431035706592040680"
+ "43848484065292542884106550381079282660840705126574766636237650938379223350"
+ "073087806800887586256085275775217219429527000017403144");
+
+ int_type y(
+ "29156720459736055974643337783563754269574952607968485689453462316428566668"
+ "95504701770860331979649536167161534866285341319360225416010322271645564229"
+ "97610536562445338176729838019564690253931232562709745122032537539983616770"
+ "01864876491464203683664927984801289460556480278145114367860332493722569194"
+ "34026051618152579992400234314328079213866348120156368725488604236521299603"
+ "05243915357553896356662519397274629471920043679673543282319268893065423613"
+ "03777840501083119668898860689222271939900089123195611475211708096094521743"
+ "23436842195705603262202927396682954198215622617086455718070601797199587530"
+ "86110222151397352239086193648500251298495752840008363650931395221675337916"
+ "21665907282124706187656074325458499695895652068822763794228458103499408841"
+ "68233732651102406546734395563663969020820490032431359396293047454261598159"
+ "68165818673838448637209074584819780088546111644065538550490486693301185614"
+ "61602638472505490238203390055056474763248195271964604045005807592301719483"
+ "66411676459481184297663915491569500245585996483678005964410842919747216111"
+ "69086269285356198998091850661544255466466926579668887000118948737207396398"
+ "39189399212362197497646493143022100680619252808094160907526003969639965485"
+ "31238493375062268758735445211914107215235958346264702774326161208396163240"
+ "36339482493382189215697343908873498104516190541170342091008828518924813674"
+ "46253090923280613514725437269574928515018666111820866090440006060807129643"
+ "38626199608899966829344884873038261232122027815715568990196536130996880104"
+ "97887027262726591236620461428328000537452828616386217063092509908555188454"
+ "27278763741671312528892659532960085933913140197210561287118971031419725940"
+ "702202830556069344716729071140147820999566475298895832");
+ int_type z = x + y;
+ BOOST_CHECK_EQUAL(z,
+ "29156720459736055974643337783563754269574952607968485689453462316428566668"
+ "95504701770860331979649536167161534866285341319360225416010322271645564229"
+ "97610536562445338176729838019564690253931232562709745122032537539983616770"
+ "01864876491464203683664927984801289460556480278145114367860332493722569194"
+ "34026051618152579992400234314328079213866348120156368725488604236521299603"
+ "05243915357553896356662519397274629471920043679673543282319268893065423613"
+ "03777840501083119668898860689222271939900089123195611475211708096094521743"
+ "23436842195705603262202927396682954198215622617086455718070601797199587530"
+ "86110222151397352239086193648500251298495752840008363650931395221675337916"
+ "98229111692003724288978811993802563691720556826135049569789072875386341921"
+ "46056289557079127459584946918992309735895377322330454248946150142111699445"
+ "53881094205816145134607470652535549600997027605841038574213810844152978690"
+ "13474389623600813397701308241680562881473925776008866830078469711772545088"
+ "07246748716690158241184166692724503078372965806765577184606172521551358084"
+ "40379695145323932059261805059926955512846897421958614254965296148999518852"
+ "38079928742973414972989829006689054343420806756435742320089116310183595016"
+ "32333023146526858931582903019587792806384013392977584153138095724941252015"
+ "74537569610038656150792399137601660565904524159964225658005445459306552111"
+ "49706958876672854958299017649846556032816112174214910877558146836471751674"
+ "87770809016666857157892528580561924741784775192201840382541017031670058750"
+ "31085546374923651063130124371905384081311775557435970456523545615147229134"
+ "71127247806963855412999209914039368594753845323785327923356621969798949290"
+ "775290637356956930972814346915365040429093475316298976");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(increment1, int_type, IntTypes)
+{
+ int_type x("0");
+ for (int i = 0; i < 10; ++i)
+ ++x;
+ BOOST_CHECK_EQUAL(x, "10");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(increment2, int_type, IntTypes)
+{
+ int_type x("-4");
+ for (int i = 0; i < 10; ++i)
+ ++x;
+ BOOST_CHECK_EQUAL(x, "6");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(increment3, int_type, IntTypes)
+{
+ int_type x("-130");
+ for (int i = 0; i < 10; ++i)
+ ++x;
+ BOOST_CHECK_EQUAL(x, "-120");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(increment4, int_type, IntTypes)
+{
+ int_type x("120");
+ for (int i = 0; i < 10; ++i)
+ ++x;
+ BOOST_CHECK_EQUAL(x, "130");
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/assign.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/assign.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,120 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_zero, int_type, IntTypes)
+{
+ int_type x;
+ x = "0";
+ BOOST_CHECK_EQUAL(!x, true);
+}
+/*
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_dec1, int_type, IntTypes)
+{
+ int_type x;
+ x = "269513460000009900000000";
+ BOOST_CHECK_EQUAL(x, "269513460000009900000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_dec2, int_type, IntTypes)
+{
+ int_type x;
+ x = "-269513460000009900000000";
+ BOOST_CHECK_EQUAL(x, "-269513460000009900000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_oct1, int_type, IntTypes)
+{
+ int_type x;
+ x = "012345676543210000001";
+ BOOST_CHECK_EQUAL(x, "012345676543210000001");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_oct2, int_type, IntTypes)
+{
+ int_type x;
+ x = "-012345676543210000001";
+ BOOST_CHECK_EQUAL(x, "-012345676543210000001");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_hex1, int_type, IntTypes)
+{
+ int_type x;
+ x = "0xabcdef123456789000000000005000000000000007ffffff";
+ BOOST_CHECK_EQUAL(x, "0xabcdef123456789000000000005000000000000007ffffff");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_hex2, int_type, IntTypes)
+{
+ int_type x;
+ x = "-0xabcdef123456789000000000005000000000000007ffffff";
+ BOOST_CHECK_EQUAL(x, "-0xabcdef123456789000000000005000000000000007ffffff");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_hex3, int_type, IntTypes)
+{
+ int_type x;
+ x = "-0xABCDEF00000123456798EEEEEEEEEE";
+ BOOST_CHECK_EQUAL(x, "-0xABCDEF00000123456798EEEEEEEEEE");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign_hex4, int_type, IntTypes)
+{
+ int_type x;
+ x = "-0Xabcdef00000123456798eeeeeeeeee";
+ BOOST_CHECK_EQUAL(x, "-0Xabcdef00000123456798eeeeeeeeee");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign1, int_type, IntTypes)
+{
+ int_type x("-0x1");
+ x = "0123456765432100000000000000000000001";
+ BOOST_CHECK_EQUAL(x, "0123456765432100000000000000000000001");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign2, int_type, IntTypes)
+{
+ int_type x("-0xabcedf0303030300000000000000");
+ x = "01";
+ BOOST_CHECK_EQUAL(x, "01");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign3, int_type, IntTypes)
+{
+ int_type x("0xabcedf0303030300000000000000");
+ x = "-500";
+ BOOST_CHECK_EQUAL(x, "-500");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(op_assign4, int_type, IntTypes)
+{
+ int_type x("0x0");
+ x = "-0x500aaaaaaaaaaaa000000";
+ BOOST_CHECK_EQUAL(x, "-0x500aaaaaaaaaaaa000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(assign1, int_type, IntTypes)
+{
+ int_type x;
+ x.assign("123456789876543210000001", std::ios::dec);
+ BOOST_CHECK_EQUAL(x, "123456789876543210000001");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(assign2, int_type, IntTypes)
+{
+ int_type x;
+ x.assign("abcdefabcdef1234567890", std::ios::hex);
+ BOOST_CHECK_EQUAL(x, "0xabcdefabcdef1234567890");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(assign3, int_type, IntTypes)
+{
+ int_type x("-564897123123456456789789789897");
+ x.assign("1234567000000000000000000000000077", std::ios::oct);
+ BOOST_CHECK_EQUAL(x, "01234567000000000000000000000000077");
+}
+*/

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/bool_conversion.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/bool_conversion.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,57 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(bool1, int_type, IntTypes)
+{
+ // this just tests operator == (const int_type&, bool)
+ const int_type x("1");
+ const int_type y("0");
+ BOOST_CHECK_EQUAL(x, true);
+ BOOST_CHECK_EQUAL(y, false);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(bool_or, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("0");
+ const bool z = x || y;
+ BOOST_CHECK_EQUAL(z, true);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(bool_and1, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("0");
+ const bool z = x && y;
+ BOOST_CHECK_EQUAL(z, false);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(bool_and2, int_type, IntTypes)
+{
+ const int_type x("-1");
+ const int_type y("-1");
+ const bool z = x && y;
+ BOOST_CHECK_EQUAL(z, true);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(bool_loop_condition1, int_type, IntTypes)
+{
+ int_type x("5");
+ while (x)
+ --x;
+ BOOST_CHECK_EQUAL(x, false);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(bool_loop_condition2, int_type, IntTypes)
+{
+ int_type x("-5");
+ while (x)
+ ++x;
+ BOOST_CHECK_EQUAL(x, false);
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/cmp.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/cmp.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,589 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_eq1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int_type y("0");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_eq2, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("1");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_eq3, int_type, IntTypes)
+{
+ const int_type x("0xeeffeeeeee000000000000001");
+ const int_type y("0xeeffeeeeee000000000000001");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_eq4, int_type, IntTypes)
+{
+ const int_type x("-0xeeffeeeeee000000000000001");
+ const int_type y("-0xeeffeeeeee000000000000001");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ne1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int_type y("1");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ne2, int_type, IntTypes)
+{
+ const int_type x("0xaaaaaaaaaaaaaaeeeeeeeeeeeeeee");
+ const int_type y("0xaaaaaaaaaaaaaabbbbbbbbbbbbbb8");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ne3, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("-1");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_lt1, int_type, IntTypes)
+{
+ const int_type x("12");
+ const int_type y("13");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_lt2, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("123456789");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_lt3, int_type, IntTypes)
+{
+ const int_type x("0x100000000000000000000");
+ const int_type y("0x100000000000000000001");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_lt4, int_type, IntTypes)
+{
+ const int_type x("15");
+ const int_type y("1023");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_lt5, int_type, IntTypes)
+{
+ const int_type x("-1");
+ const int_type y("0");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_lt6, int_type, IntTypes)
+{
+ const int_type x("-0x589789");
+ const int_type y("0x589789");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_gt1, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("0");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_gt2, int_type, IntTypes)
+{
+ const int_type x("0xfffffffffffffffffffffffff");
+ const int_type y("0");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_gt3, int_type, IntTypes)
+{
+ const int_type x("0xffffffffffffffeeeeeeeeeee1");
+ const int_type y("0xffffffffffffffeeeeeeeeeee0");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_gt4, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("-1");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_gt5, int_type, IntTypes)
+{
+ const int_type x("0xffffffffffffffeeeeeeeeeee1");
+ const int_type y("-0xffffffffffffffeeeeeeeeeee0");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_le1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int_type y("0");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_le2, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int_type y("1");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_le3, int_type, IntTypes)
+{
+ const int_type x("0x123456789fffffffffff");
+ const int_type y("0x123456789fffffffffff");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_le4, int_type, IntTypes)
+{
+ const int_type x("0x11");
+ const int_type y("0x49941faaaaaaaa332134");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_le5, int_type, IntTypes)
+{
+ const int_type x("-0x123456789fffffffffff");
+ const int_type y("0x123456789fffffffffff");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_le6, int_type, IntTypes)
+{
+ const int_type x("-0x123456789fffffffffff");
+ const int_type y("-0x123456789fffffffffff");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ge1, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int_type y("1");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ge2, int_type, IntTypes)
+{
+ const int_type x("0xa0a0");
+ const int_type y("0");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ge3, int_type, IntTypes)
+{
+ const int_type x("0xff00ff00000000000000001ff");
+ const int_type y("0xff00ff00000000000000000ff");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ge4, int_type, IntTypes)
+{
+ const int_type x("0xff00ff00000000000000000ff");
+ const int_type y("-0xff00ff00000000000000000ff");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(cmp_ge5, int_type, IntTypes)
+{
+ const int_type x("-0xff00ff00000000000000000ff");
+ const int_type y("-0xff00ff00000000000000000ff");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_integral1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int y = 0;
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_integral2, int_type, IntTypes)
+{
+ const int_type x("20");
+ const unsigned int y = 20;
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_integral3, int_type, IntTypes)
+{
+ const int_type x("30000");
+ const int y = 30000;
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_integral4, int_type, IntTypes)
+{
+ const int_type x("0xffff0000");
+ const unsigned long y = 0xffff0000;
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_integral5, int_type, IntTypes)
+{
+ const int_type x("-30000");
+ const int y = -30000;
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_integral1, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int y = 0;
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_integral2, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int y = -10000;
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_integral3, int_type, IntTypes)
+{
+ const int_type x("-10000");
+ const unsigned int y = 10000;
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_integral4, int_type, IntTypes)
+{
+ const int_type x("-10000");
+ const int y = -10001;
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_lt_integral1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int y = 1;
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_lt_integral2, int_type, IntTypes)
+{
+ const int_type x("123456789");
+ const unsigned long y = 123456790;
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_lt_integral3, int_type, IntTypes)
+{
+ const int_type x("-0x500");
+ const int y = -0x400;
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_lt_integral4, int_type, IntTypes)
+{
+ const int_type x("-0x500");
+ const unsigned int y = 0x400;
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_gt_integral1, int_type, IntTypes)
+{
+ const int_type x("1");
+ const int y = -1;
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_gt_integral2, int_type, IntTypes)
+{
+ const int_type x("0x5000000addddddd");
+ const unsigned int y = 1156;
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_gt_integral3, int_type, IntTypes)
+{
+ const int_type x("-1321");
+ const int y = -1500;
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_le_integral1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int y = 0;
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_le_integral2, int_type, IntTypes)
+{
+ const int_type x("0xffff");
+ const unsigned int y = 0xffff;
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_le_integral3, int_type, IntTypes)
+{
+ const int_type x("0xaa0");
+ const unsigned int y = 0xf000;
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_le_integral4, int_type, IntTypes)
+{
+ const int_type x("-0x100");
+ const int y = -0x100;
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_le_integral5, int_type, IntTypes)
+{
+ const int_type x("-0x100");
+ const int y = 0x100;
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_le_integral6, int_type, IntTypes)
+{
+ const int_type x("-0x100");
+ const unsigned int y = 0x100;
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ge_integral1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int y = 0;
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ge_integral2, int_type, IntTypes)
+{
+ const int_type x("100");
+ const int y = -100;
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ge_integral3, int_type, IntTypes)
+{
+ const int_type x("0x56a4f564aaa445456");
+ const unsigned int y = 0xaab;
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ge_integral4, int_type, IntTypes)
+{
+ const int_type x("-100");
+ const int y = -100;
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_eq_mp_int1, int_type, IntTypes)
+{
+ const int x = 0;
+ const int_type y("0");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_eq_mp_int2, int_type, IntTypes)
+{
+ const unsigned int x = 1000;
+ const int_type y("1000");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_eq_mp_int3, int_type, IntTypes)
+{
+ const int x = -1000;
+ const int_type y("-1000");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ne_mp_int1, int_type, IntTypes)
+{
+ const int x = 0;
+ const int_type y("0x1000");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ne_mp_int2, int_type, IntTypes)
+{
+ const int x = -500;
+ const int_type y("500");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ne_mp_int3, int_type, IntTypes)
+{
+ const unsigned int x = 500;
+ const int_type y("0xcaaff500");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ne_mp_int4, int_type, IntTypes)
+{
+ const int x = 500;
+ const int_type y("-500");
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_lt_mp_int1, int_type, IntTypes)
+{
+ const unsigned int x = 500;
+ const int_type y("0xcaaff500");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_lt_mp_int2, int_type, IntTypes)
+{
+ const int x = -500;
+ const int_type y("0");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_lt_mp_int3, int_type, IntTypes)
+{
+ const int x = -0x800;
+ const int_type y("-0x500");
+ BOOST_CHECK_LT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_gt_mp_int1, int_type, IntTypes)
+{
+ const int x = 1;
+ const int_type y("0");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_gt_mp_int2, int_type, IntTypes)
+{
+ const unsigned int x = 1000;
+ const int_type y("999");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_gt_mp_int3, int_type, IntTypes)
+{
+ const int x = -0x999;
+ const int_type y("-0x1000");
+ BOOST_CHECK_GT(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_le_mp_int1, int_type, IntTypes)
+{
+ const unsigned int x = 999;
+ const int_type y("999");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_le_mp_int2, int_type, IntTypes)
+{
+ const int x = -1;
+ const int_type y("0x99999999999999");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_le_mp_int3, int_type, IntTypes)
+{
+ const int x = -0x999;
+ const int_type y("-0x999");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_le_mp_int4, int_type, IntTypes)
+{
+ const int x = -0x1000;
+ const int_type y("-0x999");
+ BOOST_CHECK_LE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ge_mp_int1, int_type, IntTypes)
+{
+ const unsigned int x = 999;
+ const int_type y("999");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ge_mp_int2, int_type, IntTypes)
+{
+ const int x = 1023;
+ const int_type y("1010");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ge_mp_int3, int_type, IntTypes)
+{
+ const int x = -0x1023;
+ const int_type y("-0x1023");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ge_mp_int4, int_type, IntTypes)
+{
+ const int x = 0x1023;
+ const int_type y("-0x1023");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(integral_ge_mp_int5, int_type, IntTypes)
+{
+ const unsigned int x = 0x1023;
+ const int_type y("-0x102305615645ff");
+ BOOST_CHECK_GE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_char_ptr1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const char* y = "0";
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_char_ptr2, int_type, IntTypes)
+{
+ const int_type x("0x456561fcaa547650456456");
+ const char* y = "0x456561fcaa547650456456";
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_eq_char_ptr3, int_type, IntTypes)
+{
+ const int_type x("-0x500000");
+ const char* y = "-0x500000";
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_char_ptr1, int_type, IntTypes)
+{
+ const int_type x("15");
+ const char* y = "22";
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_char_ptr2, int_type, IntTypes)
+{
+ const int_type x("0x456561fcaa547650456456");
+ const char* y = "-0x456561fcaa547650456456";
+ BOOST_CHECK_NE(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mp_int_ne_char_ptr3, int_type, IntTypes)
+{
+ const int_type x("-0x456561fcaa547650456456");
+ const char* y = "0x456561fcaa547650456456";
+ BOOST_CHECK_NE(x, y);
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/gcd.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/gcd.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,62 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(gcd1, int_type, IntTypes)
+{
+ const int_type x("10");
+ const int_type y("2");
+ const int_type z = boost::mp_math::gcd(x,y);
+ BOOST_CHECK_EQUAL(z, "2");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(gcd2, int_type, IntTypes)
+{
+ const int_type x("456489798");
+ const int_type y("987");
+ const int_type z = boost::mp_math::gcd(x,y);
+ BOOST_CHECK_EQUAL(z, "3");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(gcd3, int_type, IntTypes)
+{
+ const int_type x("-16384");
+ const int_type y("16384");
+ const int_type z = boost::mp_math::gcd(x,y);
+ BOOST_CHECK_EQUAL(z, "16384");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(gcd4, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int_type y("0");
+ const int_type z = boost::mp_math::gcd(x,y);
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+#ifdef BOOST_HAS_VARIADIC_TMPL
+BOOST_AUTO_TEST_CASE_TEMPLATE(variadic_gcd1, int_type, IntTypes)
+{
+ const int_type a("42");
+ const int_type b("56");
+ const int_type c("140");
+ const int_type z = boost::mp_math::gcd(a,b,c);
+ BOOST_CHECK_EQUAL(z, "14");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(variadic_gcd2, int_type, IntTypes)
+{
+ const int_type a("1200000000");
+ const int_type b("2400000000");
+ const int_type c("3600000000");
+ const int_type d("600000000000000");
+ const int_type z = boost::mp_math::gcd(a,b,c,d);
+ BOOST_CHECK_EQUAL(z, "1200000000");
+}
+#endif
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/jacobi.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/jacobi.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,32 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(jacobi1, int_type, IntTypes)
+{
+ const int_type x("1236");
+ const int_type y("20003");
+ const int z = boost::mp_math::jacobi(x,y);
+ BOOST_CHECK_EQUAL(z, 1);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(jacobi2, int_type, IntTypes)
+{
+ const int_type x("987897");
+ const int_type y("987");
+ const int z = boost::mp_math::jacobi(x,y);
+ BOOST_CHECK_EQUAL(z, 0);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(jacobi3, int_type, IntTypes)
+{
+ const int_type x("610");
+ const int_type y("987");
+ const int z = boost::mp_math::jacobi(x,y);
+ BOOST_CHECK_EQUAL(z, -1);
+}

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/lcm.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/lcm.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,78 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(lcm1, int_type, IntTypes)
+{
+ const int_type x("0");
+ const int_type y("0");
+ const int_type z = boost::mp_math::lcm(x,y);
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(lcm2, int_type, IntTypes)
+{
+ const int_type x("51111");
+ const int_type y("0");
+ const int_type z = boost::mp_math::lcm(x,y);
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(lcm3, int_type, IntTypes)
+{
+ const int_type x("4");
+ const int_type y("6");
+ const int_type z = boost::mp_math::lcm(x,y);
+ BOOST_CHECK_EQUAL(z, "12");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(lcm4, int_type, IntTypes)
+{
+ const int_type x("-4");
+ const int_type y("6");
+ const int_type z = boost::mp_math::lcm(x,y);
+ BOOST_CHECK_EQUAL(z, "12");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(lcm5, int_type, IntTypes)
+{
+ const int_type x("4");
+ const int_type y("-6");
+ const int_type z = boost::mp_math::lcm(x,y);
+ BOOST_CHECK_EQUAL(z, "12");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(lcm6, int_type, IntTypes)
+{
+ const int_type x("-4");
+ const int_type y("-6");
+ const int_type z = boost::mp_math::lcm(x,y);
+ BOOST_CHECK_EQUAL(z, "12");
+}
+
+#ifdef BOOST_HAS_VARIADIC_TMPL
+BOOST_AUTO_TEST_CASE_TEMPLATE(variadic_lcm1, int_type, IntTypes)
+{
+ const int_type a("120");
+ const int_type b("204");
+ const int_type c("136");
+ const int_type z = boost::mp_math::lcm(a,b,c);
+ BOOST_CHECK_EQUAL(z, "2040");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(variadic_lcm2, int_type, IntTypes)
+{
+ const int_type a("12010");
+ const int_type b("3299");
+ const int_type c("84780");
+ const int_type d("15");
+ const int_type z = boost::mp_math::lcm(a,b,c,d);
+ BOOST_CHECK_EQUAL(z, "335906753220");
+}
+#endif
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/modinv.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/modinv.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,33 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modinv1, int_type, IntTypes)
+{
+ const int_type a("35");
+ const int_type m("33");
+ const int_type i = boost::mp_math::modinv(a, m);
+ BOOST_CHECK_EQUAL(i, "17");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modinv2, int_type, IntTypes)
+{
+ const int_type a("17");
+ const int_type m("26");
+ const int_type i = boost::mp_math::modinv(a, m);
+ BOOST_CHECK_EQUAL(i, "23");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modinv3, int_type, IntTypes)
+{
+ const int_type a("982451111"); // is a prime
+ const int_type m("982451653"); // is a prime
+ const int_type i = boost::mp_math::modinv(a, m);
+ BOOST_CHECK_EQUAL(i, "871880526");
+}
+
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/modpow.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/modpow.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,103 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow1, int_type, IntTypes)
+{
+ const int_type x("2");
+ const int_type exp("14");
+ const int_type m("8");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow2, int_type, IntTypes)
+{
+ const int_type x("4");
+ const int_type exp("13");
+ const int_type m("497");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "445");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow3, int_type, IntTypes)
+{
+ const int_type x("2395422");
+ const int_type exp("2424832");
+ const int_type m("2424833");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "1");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow4, int_type, IntTypes)
+{
+ const int_type x("184");
+ const int_type exp("560");
+ const int_type m("561");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "1");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow5, int_type, IntTypes)
+{
+ const int_type x("997028168093060821869770104094480850560519901475");
+ const int_type exp("7455602825647884208337395736200454918783366342656");
+ const int_type m("7455602825647884208337395736200454918783366342657");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "1");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow6, int_type, IntTypes)
+{
+ const int_type x("184");
+ const int_type exp("5600");
+ const int_type m("2668");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "552");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow7, int_type, IntTypes)
+{
+ const int_type x("0x201abcff00aaffffffffffffffffffffffffffffffffffffffffff"
+ "ffffffffd6d7");
+ const int_type exp("0x123456789abcdef01");
+ // a modulus of type unrestricted diminished radix (2^253 - 41);
+ const int_type m("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffff"
+ "ffffffffd7");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "0x8f112a89871984cde410bb05621d5a6073557d2da0444b6681699"
+ "80b5ef825a");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow8, int_type, IntTypes)
+{
+ const int_type x("0x201abcff00aaffffffffffffffffffffffffffffffffffffffffff"
+ "ffffffffd6d7123456789abcdef01123456789abcdef01ffffffff");
+ const int_type exp("0x123456789abcdef018978979899");
+ // a modulus of type unrestricted diminished radix slow (2^503 - exp)
+ const int_type m("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffff"
+ "fffffffffffffffffffffffffffffffffffffffffffffedcba987654"
+ "3210fe7687686767");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "0x1ada35751ae1f5fec7ab0e60f6c924d5f4a4a5d8f6786cdd78838"
+ "5ab16ebd994ee9aaea5faef3f490822ef443fd3e169caa3b608162e"
+ "01d40a593e775c9fa5");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(modpow9, int_type, IntTypes)
+{
+ const int_type x("0x201abcff00aaffffffffffffffffffffffffffffffffffffffffff"
+ "ffffffffd6d7123456789abcdef01123456789abcdef01ffffffff");
+ const int_type exp("0x123456789abcdef018978979899");
+ // a modulus of type restricted diminished radix (2^256 - 53)
+ const int_type m("0xffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+ "ffffffffcb");
+ const int_type z = boost::mp_math::modpow(x, exp, m);
+ BOOST_CHECK_EQUAL(z, "0x777b5d9b290fbb5f99e4668cf1b0f723d3228fc252da492c54b75"
+ "8379f3024e4");
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/mul.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/mul.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,373 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul_assign1, int_type, IntTypes)
+{
+ int_type x("12");
+ const int_type y("22459455");
+ x *= y;
+ BOOST_CHECK_EQUAL(x, "269513460");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul1, int_type, IntTypes)
+{
+ const int_type x("12");
+ const int_type y("22459455");
+ const int_type z = x * y;
+ BOOST_CHECK_EQUAL(z, "269513460");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul2, int_type, IntTypes)
+{
+ const int_type x("280708");
+ const int_type y("2245945");
+ const int_type z = x * y;
+ BOOST_CHECK_EQUAL(z, "630454729060");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul3, int_type, IntTypes)
+{
+ const int_type x("-65536");
+ const int_type y("65536");
+ const int_type z = x * y;
+ BOOST_CHECK_EQUAL(z, "-4294967296");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul4, int_type, IntTypes)
+{
+ const int_type x("-1234567890123456789");
+ const int_type y("-9877771234567890123");
+ const int_type z = x * y;
+ BOOST_CHECK_EQUAL(z, "12194779192182653090000267987090395047");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul5, int_type, IntTypes)
+{
+ const int_type x("789456120556882111687894651457623561325656871513");
+ const int_type y("54564563128978513215");
+ const int_type z = x * y;
+ BOOST_CHECK_EQUAL(z, "43076328327684465744675616648356768900793087398990591539995027544295");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul6, int_type, IntTypes)
+{
+ // this tests karatsuba multiplication for 8, 16 and 32 bit digit_type
+ const int_type x(
+ "87500402519005030061267904448809305029512439942506161234260852587645856336"
+ "94640987107484273728362553552515383304557585868121651546490330517814007487"
+ "34682745159208158750835203309620570274592666481348052963762094268695162425"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "59441070673981642057711662497893572913873133654626566743289483229067287310"
+ "16863866837882738076436342057320810154710294295605465397209378421688020320"
+ "35702406032061642794728883255642074744145228324022219347019013411158803532"
+ "45994041206565648683544493690427219798945006072652042753387791345064784511"
+ "50227920502852884378111055250850357557404795594025600468996407045934090727"
+ "08041078777870387730504");
+ const int_type y(
+ "87500402519005030061267904448809305029512439942506161234260852587645856336"
+ "94640987107484273728362553552515383304557585868121651546490330517814007487"
+ "34682745159208158750835203309620570274592666481348052963762094268695162425"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "59441070673981642057711662497893572913873133654626566743289483229067287310"
+ "16863866837882738076436342057320810154710294295605465397209378421688020320"
+ "35702406032061642794728883255642074744145228324022219347019013411158803532"
+ "45994041206565648683544493690427219798945006072652042753387791345064784511"
+ "50227920502852884378111055250850357557404795594025600468996407045934090727"
+ "08041078777870387730504938308922524767076619493071600607096868205642593777"
+ "83064672064693123083586511497969514956199763260628691421422356349215807298"
+ "53893432372651287096347803705731068491268031212879821570628466049198139563"
+ "07225373203247341492567070512742515269237115281940442618925655326204507165"
+ "43018685973456180521304052296263372550548657267007681462726186588489921154"
+ "03738735312309811855295260282588410141887442245474311543699839300870263148"
+ "89969642893224272388306131900850182843780525186002406202200057400419364041"
+ "12480917884571681605871307558328122948240801747503773233227317344565943160"
+ "78184811118761000119446172201197213166958413376441353073591860771242469526"
+ "34162171790217465073689788174652534961638870987430329380376975097234424950"
+ "28626203467171261194438985008578074151902043501430333019202385199270557942"
+ "82069487032265791643884311563532673152911052140807076806223793474752085674"
+ "51690168224265201474031350018449280412602665727006489664736651532321662145"
+ "22395731894311806382965185156526606660906262290677223798531105431808835740"
+ "80068277468617762211054331907328141344243411630209274782352265433366236954"
+ "62340796945506470082986574244652633468578747126384423018749343237426427830"
+ "62597495610006322516869046617226177792891514414040880511098169575819779926"
+ "53267511946096311413217967853431922008343789549408902117132966444741997352"
+ "58418657379544687590177580275674377304583931111620683151992749560156615440"
+ "09956001573216294273550652829235006290995819615078227235050765818475452342"
+ "95118077784320900839083926375344280915278665450149678774001364483022411118"
+ "86989210613864536835695555040115554865868694788922281253334356037168116291"
+ "99227045413249316876243936449829162763370534672670641521910718921661373160"
+ "93948899172794003245737017747952580428164207428777214495975431645589773283"
+ "12391742034637254884903040666536846003583703264118132242307521988982264762"
+ "13953490712153270721924306359669195669881431604926261623147833800912453474"
+ "06542388952383807976431616628717886593805647129190060659586374949333503420"
+ "5241703455510726935");
+
+ const int_type z = x * y;
+
+ const int_type w(
+ "76563204409879018101322737668344063995824904757312285775560614771886933079"
+ "77822556905976720912850551355328340715074887289899094852653102687850101285"
+ "85715275531977696497398396067715769512450915961775500023723324150851793075"
+ "51871751151095323159497918186624088118225730504044262785072662119470825604"
+ "40835072257208973943520251201155002832786969323087571220195329601804141972"
+ "71293425859967733061169954398382700046379970842289727254846347411792122453"
+ "98890529530611217475343335863666953662801553948341581412563112340543629531"
+ "01094529771464590172847457807673685591148055046712881378811934516545088775"
+ "38198087116656466935095055228728162461388333618793883566996616940381738437"
+ "03453867953392241443573580380271627517797446062394044787118140775664622031"
+ "49144609407766890328547643707523663509662747376486271392344480900673178645"
+ "33198519112197059826509662943577383543858946941049753393431035706592040680"
+ "43848484065292542884106550381079282660840705126574766636237650938379223350"
+ "07308780680088758625608527577521721942952700001740314426688555136034651920"
+ "92948869415921251533176579828351648585255631612516166131530519177426817087"
+ "53127165191235539369253485175856164884318259457319518574027800748530624722"
+ "30999853784133144744590149844870058500033133557974954747400058296439058233"
+ "59080109028703731380219724583279605028258137468666258706566102379192203551"
+ "90274426910716106736469216457355540125186992654301008720830993368763363204"
+ "11036960264301276622450044075944548104639523605502445335712149154791061273"
+ "09156720459736055974643337783563754269574952607968485689453462316428566668"
+ "95504701770860331979649536167161534866285341319360225416010322271645564229"
+ "97610536562445338176729838019564690253931232562709745122032537539983616770"
+ "01864876491464203683664927984801289460556480278145114367860332493722569194"
+ "34026051618152579992400234314328079213866348120156368725488604236521299603"
+ "05243915357553896356662519397274629471920043679673543282319268893065423613"
+ "03777840501083119668898860689222271939900089123195611475211708096094521743"
+ "23436842195705603262202927396682954198215622617086455718070601797199587530"
+ "86110222151397352239086193648500251298495752840008363650931395221675337916"
+ "21665907282124706187656074325458499695895652068822763794228458103499408841"
+ "68233732651102406546734395563663969020820490032431359396293047454261598159"
+ "68165818673838448637209074584819780088546111644065538550490486693301185614"
+ "61602638472505490238203390055056474763248195271964604045005807592301719483"
+ "66411676459481184297663915491569500245585996483678005964410842919747216111"
+ "69086269285356198998091850661544255466466926579668887000118948737207396398"
+ "39189399212362197497646493143022100680619252808094160907526003969639965485"
+ "31238493375062268758735445211914107215235958346264702774326161208396163240"
+ "36339482493382189215697343908873498104516190541170342091008828518924813674"
+ "46253090923280613514725437269574928515018666111820866090440006060807129643"
+ "38626199608899966829344884873038261232122027815715568990196536130996880104"
+ "97887027262726591236620461428328000537452828616386217063092509908555188454"
+ "27278763741671312528892659532960085933913140197210561287118971031419725940"
+ "70220283055606934471672907114014782099956647529889583250740029484462218658"
+ "62960901244568848989478467720707250809806379509214397878558772543587967635"
+ "96161034019645060913914198361071023036142203589230741296078930717247341831"
+ "26204308310630181474853421564903407641109879794777661716811159608177803322"
+ "61170286373919980640839261570604290919653466216587527613203517128403418424"
+ "791614399508711582164287714644181913925240");
+
+ BOOST_CHECK_EQUAL(z, w);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(mul7, int_type, IntTypes)
+{
+ // this tests toom cook multiplication for 8, 16 and 32 bit digit_type
+ const int_type x(
+ "0x5004a2519b00503006126bb044af8930502951243994250616123426085258764a856336"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "9464098710748f27372836255355251ae330455ffaa58681216515eeff0330517814dd7487"
+ "34682745159208158750835203309620570274592666481348052963762094268695162425"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "5944107067ac5771a1662497b8b93cfe57291387313365462656674328aaaaaf9067287310"
+ "ea6863ec68378827380764363420573208101547102942bf05465397209378421688020320"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "59441070673981642057711662497893572913873133654626566743289483229067287310"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "16863866837882738076436342057320810154710294295605465397209378421688020320"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "f84c878148cc7020890befffaa4506cebbef9a3f7c67178f2");
+ const int_type y(
+ "0x875aa402519005030061267904ccc8809d0502243994250616123426085258764585633a"
+ "94640987107484273728362553552515383304557585868121651546490330517814007487"
+ "34682745159208158750835203309620570274592666481348052963762094268695162425"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "59441070673981642057711662497893572913873133654626566743289483229067287310"
+ "16863866837882738076436342057320810154710294295605465397209378421688020320"
+ "357024060320616427947288832ff6420747dd145228324022219347019013411158803532"
+ "45994041206565648683544493690427219798945006072652042753387791345064784511"
+ "50227920502852884378111055250850357557404795594025600468996407045934090727"
+ "08041078777870387730504938308922524767076619493071600607096868205642593777"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "83064672064693123083586511497969514956199763260628691421422356349215807298"
+ "53893432372651287096347803705731068491268031212879821570628466049198139563"
+ "07225373203247341492562497b8b93568861230addd281940442618925655326204507165"
+ "43018685973456180521304052296263372550548657267007681462726186588489921154"
+ "03738735312309811855295260282588410141887442245474311543699839300870263148"
+ "cdd69642893224272388306131f0a850182843780525186002406202200057400419364041"
+ "12480917884571681605871307558328122948240801747503773233227317344565943160"
+ "78184811118761000119446172201197213166958413376441353073591860771242469526"
+ "34162171790217465073689788174652534961638870987430329380376975097234424950"
+ "286262034671712611944389850085780a4151902043501430333019202385199270557942"
+ "82069487032265791643884311563532673152911052140807076806223793474752085674"
+ "51690168224265201474031350018449280412602665727006489664736651532321662145"
+ "22395731894311806382965185156526606660906262290677223798531105431808835740"
+ "80068277468617762211054331907328141344243411630209274782352265433366236954"
+ "62340796945506470082986574244652633468578747126384423018749343237426427830"
+ "62597495610006322516869046617226177792891514414040880511098169575819779926"
+ "53267511946096311413217967853431922008343789549408902117132966444741997352"
+ "5841865737954468759a177580275674377304583931111620683151992749560156615440"
+ "09956001573216294273550652829235006290995819615078227235050765818475452342"
+ "95118077784320900839083926375344280915278665450149678774001364483022411118"
+ "86989210613864536835695555040115554865868694788922281253334356037168116291"
+ "99227045413249316876243936449829162763370534672670641521910718921661373160"
+ "93948899172794003245737017747952580428164207428777214495975431645589773283"
+ "12391742034637254884903040666536846003583703264118132242307521988982264762"
+ "13953490712153270721924306359669195669881431604926261623147833800912453474"
+ "06542388952383807976431616628717886593805647129190060659586374949333503420"
+ "ffab023789d7d78f78a45a45fee789001a1a");
+
+ const int_type z = x * y;
+
+ const int_type w(
+ "0x2a4ec67dcaf1afdd14bf63d7cd883f269ca00be2cae5c539545352050e33af7bb008713c"
+ "63587bc02911b0cb1fb807d94cd4a937f6e19801a28500f45ba1dc90a548e8e15e0c31536b"
+ "39f3940191a76b6fd96fda83c7aa9aa675f536633917587fbdb4990f73dc4650e19af67392"
+ "712b0a94aeec78f21523bd2ae92cee0b5d42ce2ead649060ff8134dbca0790f051b132b8fd"
+ "2f0bbe66f3226f7fe7a80c0be18fcd0238ff0100e4353f4973c1cb72c40e83804192fbd008"
+ "1e3d4dfe03e1d4c8d1ed4ba8ffe7cf5d00237598de949ab89cd6f95cbc3545a4d797e425f9"
+ "041fbe52955af28221505ce3e53cb5bc12d8d9a13f39704463db4db21aaea4fc29643a2746"
+ "2e6d3b40f9eb621106bda6223bf2aaa4f027e037acb45406cd39b242c90df3b4fae1bf788a"
+ "1529dac1ce1b77f4d1557e2aa8a4adf9c6b3b0c364ce68300b5f65efc8166dae1b2e0f8443"
+ "76975b12b72c36f2dfc4a533adca3db43955265d91d15232bcfd712e46dd4cd4f63981317b"
+ "31be8e9fc0a56275da498e8a4c13419eb8560fa05d73373ff238787b77c0b45c0b44b6b042"
+ "365bfb3b3a4d96cdb3ad7cb9b9248498a02b43a16206db5cc3f52c4cdf2c58807a68a6d1b0"
+ "f24bf8daa4eaf6ffdd3e781fd52b5fe609678d045944d7ea6a6689954b82a737b136a86d32"
+ "e8de0c6b88e66300487b83deb53038fc298c2b1d1ffe64ab7ebf0e7682b285bb567c3ad4bc"
+ "69c0e0216f5c8df2681a3e84435b39dbd4a3cd5dcdf0b776bc0b5281f8806155318e70d237"
+ "4267ca699ebdc5df58e282f7a6d2a7401a3544193741e9597df7fb92c7a0c87128b53ae873"
+ "14aacf233fc20cba4ac4835579bd82b6efcadd591dbf826d470795d64bb698202e3fc5bbd3"
+ "9ca2249167520764d448a95c7a7ed00f43d2f36f4158fccacf2f5738878099da8a323e7d2c"
+ "57579da5e348b45aabe59366085532c73c2388b3a2672b08758bdaae3746364b49d0217b27"
+ "5d22b2b4916628afd5009e103803f4ba5241413200d85e119ceb4dc876c1521047a8be7650"
+ "767b0d83fcbf991c6b04a51213692867fe4c9e452b2800fe5fc57df9d8f75cab72609a49af"
+ "92b1e2407b64ea424344a626b2e86eacdf18af6a000af8c5607019df1d670307a65df3e4bf"
+ "51e9809212a3288001e1df69a6070558e24f686ff34b50e7b2daf5f3f7abc7be88fff8fb5d"
+ "f0aab1f952f91eec5c5ff7e25d2babb61db263e7381fbe40ad81b3494c323a35d3333fcadd"
+ "d6b057c88fe2f43ec1bf754de9fdbc768457d7fc44c90c2e44f79c32849f56d7d2152b96d1"
+ "4b7735e8eae29d8e9ccdd61be1f73f7d1d2e16732505448a33145a5b1d5c342f0990a0a731"
+ "a5e034cb3c0f5658e20b8ac7f4e93c249ec9badb93c4e064b59c34b11e4327d0dacb0951ac"
+ "1c13831520a06deee884613bce16fe5b92e1e0776caf6aa1a7aadccad11a741e7c08512816"
+ "e1c4a0f8910c35450a7448c180528decdc54a9af2cf5b5244c03d088be6d8b6978f2e90baa"
+ "3ce9f85456b51768f7b2d2261785f7680e62cdc420d0e62e41aba012a391c250d3579665ec"
+ "06a0e137c8d3da6ec07be1c2f0599dcbd1f6a801a06a062734ec34889edcd57ca99bc35d5b"
+ "9686b7fc073aa06d9d052ae7d762a7dbc5740e73ef730b478acdb54455d4db80e80b03bc61"
+ "aa013ab9c0b9ece6a00e4e46c16068a2771d0c9c42432f4ef1279481886c6cf890d656a8fa"
+ "e248c9c17bedb151ea802c3b8d7918296dc38a71f173c0b6fceb72611bc817429271ff1d1f"
+ "9fc29780727dbab824eb6ff07e552c8a6679c667bbb20925b7920c7307e3f553c64e1f8962"
+ "e556168cef58af8f406f9f6847719addd6083d19e351b2281bb6f8f64789cdab8f29915f71"
+ "128cd2152ba95124b935770dda3231973037cb7c1e8d22ee4bd10331c91d4db53c291cb16c"
+ "f498366646a27bc18df39aeb5790ba6e02c9904b0fe7e6127dd412daaafdc9b1548727eb05"
+ "57e191893e391f038797139cdf054dab4a208b00dbea79313c3952bcaf8384882456dace78"
+ "117550a133acd3cc883c036e2ecb133eaca4f6df4c002589436f529f3975fde6c779ab3038"
+ "85b1decf3f9b625dd31d634e98410486ba3e3dfff5e90da22c1734fbf9b52b92db6b44af70"
+ "da57859ca38220d8a24dca3251f9f65a1abfcbd2386732f3919c88af189efeb31ee6da9deb"
+ "f70e85bbaa928abb1d2ba86d3b038c1eea98c1a36d0e783a79e578cbc3b98d9a9f4a9c0392"
+ "bf51fcb31325c1b9131f762cd31583c231d786190dc92752781192a72ff75c3c8c297706a0"
+ "4d14571575e076dc13c8bf2c3202bb468ef6f20f6ae27ba91a0182af2c73a40477a9e1d23d"
+ "60fc5f57e9f3a86315b11ea7dc922ba70d38a24c18e1552e15239b2a29d6fc7517f5aabdd5"
+ "e0c800178beeac9b582c44af59f7c2cee341813eb13220d4bee3ef07e9ab8d35ccc0f684e9"
+ "902affb65f87cee827e6bd42fbc433df0070dc210d078fdc92fb7f559b577150e28f21f64a"
+ "c0edc61da523858e62cca0c85b8c16b8bd784f7ed8efb96314e75b3b9bd26ea93bdfc45565"
+ "85ea59cda0c92be16321ed27d93b9a05980574fc99dcb079e6145a0b0ab0c4cbebdc0e51af"
+ "2825278224922511ab721f412589b8a160fa95c3bc9038a3af4a330f5e796d30bf60017921"
+ "bc01a0200e87c26a0afedc292ff05a3e9d564323d0e0c738bcbf24f226d9aa59944abc109a"
+ "9916f57dad39fd1c928da18c32184a230be2eef814c47cea0baea02241c34fae2c8d025a02"
+ "0ab4faf8409cbc467333b807af12473f5dc3be988bb9ef61a60ff1672e07de7f5f6bf99583"
+ "f876305337ca3bbc6b2cc1f562d9f4b90cd9e54d85e04b8aa47dcb4dd5efb271f2a1d61922"
+ "cefdabcad5c3565f3f65a3e421e688b53c15a568c368eeed28d546e47dd53afc3944bfce69"
+ "94841555ac1a1968412a5504d68ae69b2067aaf3c8516a993ffb0657f82cfcb4950e6da431"
+ "de09b4a1d104e3190af9518bd2d10921ee2a3cbba8c25e1ef98606121d60cb48dbe91994f6"
+ "afceb6ea5187fdbd6d943b24c6a2584516d014ca5549828b1c5dcb80016f5dbe91667d03c0"
+ "ed9db277261ff9a7fe77886bb1c9c7d3e95e8a4204b984115323b3a8895ae102921e807294"
+ "131b5554246e6004541e11d1e449f017f1590b18c695ab79b098683f4693e0c6d87836feae"
+ "3db0bceca8b11f9b2190b8f61d77fdad0687ce678c31059af3771bc54170fad3171efa5eaa"
+ "39a4dc3d3fa837e868d1cd704de7c1877e4b77cd9fa44d500b74d0a52cf1b9c5ca6f031005"
+ "c6362066e930694a5d8063a2f27c899a78dd4f79f89e47c46e24c454efcb034105824c009f"
+ "9ce5f9b0eb6998ee1a61a2b83ed878ac81e50ffa48f6c5eaf225a56c9cbca51312808c0c51"
+ "7f49f131c12ecb7094f389228b77db2a305a01f69975138aa67dce71b80285fa1f21993189"
+ "b38898d0e2c5e6fddb644101107f610ac20ab744140addc41021fbf68b041b80fa3c1a3851"
+ "65038651ac3a07ef76368658c5a984d28e149981a7ab931e6fa1d87aa8756331927c54443a"
+ "54177cb8617bd8f54aba47a06af8f41f28cc47d71bd153d821c0c45adbad135170cfe68429"
+ "683a0bc06e4e7a06bd060a87fb8309e4f14c31a3732eada80079072e55fc26cb02ac710791"
+ "0a95d32111198ac6c07625c117acf23fefbbff59fb4c84bc6ac1a3fde905cf1d75693caaf7"
+ "7d2728e7c66d6005a236176e85cb3b282fb7a577e5e4c617c23b2af879810b560882c93552"
+ "27ee9670073d5288c4af9e57a0c81c7af0142670dbb0a18a2f79fe3ae3791739e732784600"
+ "fe9a9a4475ad985499e81ce7a06a04368fbdd007ddb2a222a0268c086252e73f18ef9b165a"
+ "c044c5f42af698b80eba1c1b4423c3b8d010d31ea85831fae7bbb74efe9a22283c1e238d09"
+ "6ae5d00ded7ae17744925d316b3d1c92861c58e1e6668dd52f4932c1e891ed5441f29786fd"
+ "d41a78b75730b8cc193ed85ac5a667a86ba4bbc1ad45aeddc56d32e16f410ad06f5cd2e6b8"
+ "2a31feb6585cfe987b8db1dc8dfdd3a4a8b09518f341fac8f8c7aeb8052cec62bf23eab8a1"
+ "b35cab3e3ed3acc3b64e29c1cc4d7cdeaefcd61f06c61b8a48b90a838ee0aac2cc76a2e56f"
+ "d8dda42e2ff863f75132ff39dd4241ac3ac1aa21845a66bdd02b77b4c38dd5ada02e3863e0"
+ "12b5bf5ad2eae7f6b1b85b4fdf960b915c257dc2be810ce92bb82c58bc478994a71332502c"
+ "ea5e5cf5bfc2ba0480d53dd2dec046f718001eba5088463e6598488dbca8cf07024102458c"
+ "abac35a14188323195f0bcc8a4d7b006467ad4ee46e6cc61f91243e311e0a775582ca3be74"
+ "9193f6044b573435eb7185c437ce3abb6b232f7d85d5beb68ebe859b9af9d6216a5c1a236c"
+ "499c661d705e9df96466429370c573b7c02d6b66c9725f39550e9bd8f63b69dd1d91ae3b7d"
+ "daf6e53f36111e43f185b2a19e6969c95441159ab96ba7928d9a8c66a81d8cb2967d90f5b8"
+ "65bf2b0986e7e10275476faf729ff6ff275347c3afb647cfaf80b76a7d51c1530e5e305241"
+ "e46f992416baa5e204ed1ccc29ab615e71ee06a21d29fabf1c114bcb0262a5031bbb8bf5d5"
+ "a4fcf004f0276eb27cb4007eb0cfc99fc515e858170e135707b07b5f0839f602d1f1ce9eb7"
+ "a41e02aea4c95a499f9ade35d8f1de41791d62ee88fac1e74828aa5025efa0444425f58edc"
+ "1158f0c1afa86f9cf062ef973eb852fe203a48a8cc6f9ef89bbd76e5602aa93c3af0cab8e0"
+ "0433b8beaf63024c36d652dfc1065c483ce480e6b36250d8bf4c3e8500ca1ab6457fa02206"
+ "6592d25f38e376a4e9d7b1dec77b378b6daf4a3e33e5aac75ff2a93808b163e738b62d6f32"
+ "c8526d92795fa623217fcb8c4450bd0ed300742327457928fb0ac0d9a1a47c490db6d3eb56"
+ "900e091c8e047e6f618acac52dea702c4ca72acd001f2c056291d71e8e7e49ea13afae0d3f"
+ "66a7d7dd8d6a264ca4be9eb02549bf40e61f1e2e4f01fe4ceafd7855686747eb1b1acd2c96"
+ "92fcedc94");
+
+ BOOST_CHECK_EQUAL(z, w);
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/pow.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/pow.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,460 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+/*BOOST_AUTO_TEST_CASE_TEMPLATE(pow2_1, int_type, IntTypes)
+{
+ int_type x;
+ x.pow2(0);
+ BOOST_CHECK_EQUAL(x, "1");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow2_2, int_type, IntTypes)
+{
+ int_type x;
+ x.pow2(1);
+ BOOST_CHECK_EQUAL(x, "2");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow2_3, int_type, IntTypes)
+{
+ int_type x;
+ x.pow2(64);
+ BOOST_CHECK_EQUAL(x, "18446744073709551616");
+}
+*/
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow1, int_type, IntTypes)
+{
+ const int_type x("2");
+ const int_type z = pow(x, 0);
+ BOOST_CHECK_EQUAL(z, "1");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow2, int_type, IntTypes)
+{
+ const int_type x("2");
+ const int_type z = pow(x, 1);
+ BOOST_CHECK_EQUAL(z, "2");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow3, int_type, IntTypes)
+{
+ const int_type x("2");
+ const int_type z = pow(x, 64);
+ BOOST_CHECK_EQUAL(z, "18446744073709551616");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow4, int_type, IntTypes)
+{
+ const int_type x("-2");
+ const int_type z = pow(x, 64);
+ BOOST_CHECK_EQUAL(z, "18446744073709551616");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow5, int_type, IntTypes)
+{
+ const int_type x("-2");
+ const int_type z = pow(x, 63);
+ BOOST_CHECK_EQUAL(z, "-0x8000000000000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow6, int_type, IntTypes)
+{
+ const int_type x("-0x5abbdf3478aa00");
+ const int_type z = pow(x, 4);
+ BOOST_CHECK_EQUAL(z,
+ "0x40a2f27784f54fc480bce13f80a50a2ed92396abc2b4b1000000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow7, int_type, IntTypes)
+{
+ const int_type x("-0x5abbdf3478aa00");
+ const int_type z = pow(x, 5);
+ BOOST_CHECK_EQUAL(z,
+ "-0x16e8b8a052d3083215ce1982a007171c266ccb004649d9f8cf36f2f58a00000000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow8, int_type, IntTypes)
+{
+ const int_type x = pow(int_type("301"), int_type("259"));
+ const int_type z(
+ "0x16becbb1b891cbbbab4825ed1335f0f4ef5250f620023061045e87ca80d80ea7daf0cda8"
+ "023aed1a969864de781297ae556f2bba6d951ae294805dc888f6de01dac2b7dd3ab47db207"
+ "b0f980f26a54f1c7dbb3ebc6cd5b952cccc67569487fd2aea057d4326cc56aad90ecd89b3c"
+ "74c1f30f6ac637a64b706087f2fe16c3bf2be3692106717387813a8a2c9da65b657a8a2a61"
+ "abdfdc6698a6f6543d8f5ae88b192293e2a76ed402d3c914ca0c40e21fb1508cb2c5a7dfe5"
+ "1a357fa58bf9e2f1d1fdd2c3e72b600a8e7390ac0ec65cda8b0636595a83dfeed163a0e161"
+ "b17acc476db2cc246bb3b14a1b33cdfd659d43437b2c4a203e07a8f297ad3a716b53d8ce28"
+ "e84f1b3ad36ba0d2f5");
+ BOOST_CHECK_EQUAL(x, z);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(pow9, int_type, IntTypes)
+{
+ const int_type x = pow(int_type("3"), int_type("66666"));
+ const int_type z(
+ "0x8a25f1339bf63db8e5881f75e7f89ad860d393776362040a47448cfbcb4a9402558acf60"
+ "7a590c1fa521b672329cc18a63eca1cadf87465bf8b44ef05fce12fb020ebf2c2b246d9a36"
+ "af527f947f3d238d3e2504dd5a0f3a071dc98784d1084cbfc4554fc21d72f72ae65766600a"
+ "007b364d2c182ba9b9b16011c2853a28fa2455bce4ac2af57f6c8337b85a8e01fd4086f128"
+ "bedf51902d90fb9e9a7e859e65219b46ee14d5a1660f37884801c65d2f580577f7644014a7"
+ "f26f648308b7e7852fcd1702740aeddf1c63d2e41e3a70f13347c1236f8dda54db58b1df1c"
+ "0849b96ec08286e3160db6c7c71b7488d8516af84eb08e8188a4bfbf045f3ed85ad3d63a16"
+ "79a4dab46fd15caf25543e21751c164b9e7bf0c3ca98ce518e95dc7dc9c949b114aac50935"
+ "f3744f4cea72d9f857c2aed3a1b9e682dd00d6c470365b2af4f95733c16cebdd56ca2d0f23"
+ "846be5f1b6bbf0f5fa7ce974bd310e07fe23502def57e53d495364f5b6db3b11ca05582a36"
+ "d17ffb5a409044e2352bfcb4fb721e39a530c8d9d8373c50ec0063aabacff9781e9cc6df7d"
+ "aaa44256e70ec2e3e0db73b4bdcdbc62d86406dd63dcb24551bb1719232ae07381129299c1"
+ "81c17e69b45391e668c5711112e00f90d492a428c15d93e331fc50faa7f0bf3e3de80050ae"
+ "b198df940c84501f2b419b19b03b339b86b5eaed0647808fe1094601bb6d948f2865194f8f"
+ "b661e26e60ce3a0850258ae914b6c35acf512b4ff6b8adad70eb32e649757368216a02fcfb"
+ "dbc887e9003a2edc863c23c878cb9cb84e7bf478258d0c5c297bddf56dc30b87f693efdf7c"
+ "b1c6c42d867ff7c1d953749905e90c74eb8db7c83ba48a69d4c7b5a4d49bda733fb7e18ad3"
+ "df329e4bedb322678ba5b1884509ce90db795dae188978bd1308796f6d34fb4b9b8e95ca7a"
+ "af4599dcff213ace57690345ee9cca65f870fed4d59072a9de2a9d8d523b34881c78e79f6a"
+ "1666e7f01a987d6052fc995f38c92b3412ecff1a009d4c55636afa1e11dd375f909026ad7a"
+ "caf6a593e6df0a607c5f2b231de83bf86d7817dc7f927d05dea16e3752ab18ff6fcac9031b"
+ "390036a0b3c6e89f5d880a3c31755bc9bbe3b74b7cb0ff521f0c61f4b772c1dfc7fdc834e4"
+ "aedb0b257490b0b6f926648617463aceb4b6b6f16e8145cedac27bb671f4a38986c15302e5"
+ "51e1f0e5d38b767990c944b3f2a652d71eb3d3065d2872c0816a9a59bf57b760eae8748254"
+ "54e8c3623b0515c83387318a2c9c0a8c99e497f4684fd8ec03505b4b1eb7f5f3ecb8505c2e"
+ "96c0e9d8b44af13a9197d415766f38e9dcf11c4cde6232f1d43f63765d45212535a628aa1e"
+ "354bc23e810f71058e38dbeab9e2ff3f335abcb58293f4e594d643f10be1a7669b667ab735"
+ "1899f7664015a4d5b4051ac01129710f03df6dc71146123e7d443f307341cab65f197bfe87"
+ "5313d66c8dc0338e87c52773ae8f3bdba84dbf8a1a3f4f73b3e0ef9452981521d5a30c01d6"
+ "a6827882790ed81f599371c5ae2a266167cf96d9d01431a6358a669d63f21034e998b47c32"
+ "4ddd505f27253dcef488b1c203ae3f46206769669dd1122ab00dfbf36f89c557d75a6bf7be"
+ "a889f32493efb3bd63a1432c7d7130b7502d2dcc55c85a80ec915370c90f0719328d1a87e0"
+ "2652c515b710488f3509faf0792e6d853ad1fbd5322fcc5c78bf2da284fb8ebe79304db8a2"
+ "ebb0a14e5eae45a5627b8f81714821ce0e83f742fc79804e27d8bbc38eca3994243a8f5f48"
+ "ae202e7575835c760eb05742dbd11b31111450148dbfafb29ffd28718dada8f6ae40d498fc"
+ "e7d6a24ed98e1aff5e453f70def935430a795b4daddbe4945710f5553d903f95e60b731f41"
+ "8a6e570492b52e0c8b7fb00bec64703e8f62262f32d70686a9cc9244491b8e5ef606a40787"
+ "e6b41bd08c24499abf57227b142baae204fc0b4d55a81011d9252c3f4fc5543fa0fd912d13"
+ "44da807f30d314669ef47d9cef9f7e316bd3e5b706b87237b0aa86365452116f0229d3e35c"
+ "5684db8b6ae7076d6decc75822d7ef0ff94f7ed3db1f7296cdc2465faf0ea31e4e11bfe5e9"
+ "a7a65493ea438ddedf92036914a54a20f03f3d65a91fb138714b74d6e6fdea549719e3613b"
+ "2840e277dac23aa4d466b7f895801e6ad95532e1f2c3183c8f3c2adfe96fd0c0c47e23c172"
+ "bd993fe30ac299e12941a8a60ebd499b31fed0ef7c2981a862aa5ad6486eabaf38bdd838d3"
+ "8ed62fb21fc76fdc50935c3003c02fe61000218e8507511602b29969ce1648371f8fed081e"
+ "395726af42734f3cb8910f52180d01178242dcd9093dfb7abfd3bfcbcc543f495820dcb1ee"
+ "60a1b69ff7f080fc21e39f22e4aa9643558bbe37d2e92563938e3f4a8958ff7d5becc6246c"
+ "bf2e0f24481e1593122000897d171e2cf9b18bcac4951305f0ce9e74837a4cad004b5b91c3"
+ "ecc8507758143e4df2c8d5901b8e9185241a6bada332682e764e3b9d55e06132205b257c3c"
+ "8ada391d6b6a82fa493eddfdfb141371480e04a0ba6f7ffac004aef32247e99463319aeb6b"
+ "93577df50cdd3c4189478f04cdb9861c416e6a0a05ee0d60073d7f1473b06d4cc1d064b8fc"
+ "6b14d12e414f7f532d70bb953405a04c34c0edc0a6f2dc67fcbe7643bbe0cdb8275b41074b"
+ "a5a7c332fac3947f8dda001177147e8e8f1e509aa1b602c781614977c3cc06fd48115f9382"
+ "8e60f4d57f76b1a5b2fd9bfc03616eb0fba9339e4d59f2e0556c792f6ee3afd5b1369aecf6"
+ "2fab5eb9ecd6641b710a39753edc0d8c535f95c4fbbb0d44f51e8fc63dbd3bdfc48688446e"
+ "f255f4452f68b8bb0b0cba01bb0ba41ef33ddaa2c929841b9013b201424aafca3d1a98f19d"
+ "8dfe28eff5ba2f1645252ae27d3a8378d2c50b498f449291e85ebb65a82cdca952a47c77c7"
+ "680cafb603a202998d5c422d475ebc42eeba9d26a962feb579ea01509d5e47b1cf3da3a862"
+ "7527369ed4828eb893fb07fa6fcdb5c4c4fddef59dd2b04f63c09038351d7a6b12d2eefff2"
+ "b6b98af2650d7ce99c075b4bd45fd95bb07c79398341a754701b3e3d843b757c4389226fda"
+ "645adf339cb0d7a5a9966be122e103d5ea66ba6b7e17f8537139ba7a96bcf52d04f7349861"
+ "ca52e78fa5b3dbed6fac6cfcc2b254b9f5f9997d4b874e86c54b4ba4b3291b81afa23b6028"
+ "5c63cb8a59a4d52d774371e519df25cdc6099a571c668353721f34c55c2fd9e5aed9dd3526"
+ "1fba8e180f2e179101f894849c3deb5a19636442e405f48fe2bd7d984fb036a5cb933f2ac2"
+ "e350df4235d0d1219b47c0866911864fa88f83a67970cc4b051bf6214c55afcfd8501966c0"
+ "afe34612e2edbcd6e309d8486436e7ff0515fcd9a3541ee7d7a4462e21784d8e6876240afd"
+ "b74f14cf6a1ce0cdf99c7c511e3c92bc546586615e26dd8b02cc53c24d8070122b1fe63cc2"
+ "068a8b53f9f12023057bbd30a809b880bc33cbbff07b598e1190702ad8ff32044f0d3a714e"
+ "d7d86eb0e13bcf68af313453151bdb9a0ed8c550dcb9cbe28dc78a1d267f3ef25180ab3cdd"
+ "11390ce243bb2bde0ed3b1191b0f492a258d2dc73482fbedd891af36cf1f224ad7ac1b8de4"
+ "f36606294f1a228ad7eb390043b71916e9d0409a4ef0ee0f3a50f250e633008062ff6df9db"
+ "4ed7f69b396493ba0dc5a39d6804c4b93c962b3d70d25188e3a5d5e1f5487708e8dc3d7d80"
+ "989e76b69d7405b31bf12a2d043e523804b2d7ff95ad87e84bbd27cf2ac09a8c5d9762ccf3"
+ "dea56a320ec763ff4c25f2c4d4edf89c8b7512baa662548a6848411ac486af95c2987ef5f8"
+ "16ec5ffb476e560d8fd69c8ff9870b549d6da5f262abc1e07293178d5bec9a0520fbdb5a75"
+ "1663efcfb39ac505725e4e64d63841e7431fef657e0b293d8e6b6d4f8b9c81c7022ab701eb"
+ "f671896bcf9d05aa68b3c67bea8f464a000fcea3e231298c198e511654a0af214fea046f5a"
+ "cd6f204ffef81d67d17b7e0c81fd9e9e7eb88990bb39069ba164139bb2be2c816201f59c79"
+ "957cec370f81f7350614b2b6c94bcbf5f275e301db6a5b335df9b21a6898618be21e34d7c6"
+ "8a5474610d680726661ba18b39f432b257eaa2e2fb157dd4d5f1936ea1e6edc2b92088760f"
+ "74121b8335de082c7684a151ae853e3f5156b7577444b6c8e90d772fbf18259e3ea59ad4e8"
+ "177ac10728a506be1621d0064342bbb3c5ec7553dd03efa6466b9dc9740757b5e890444540"
+ "f60e9e6f32b5d770e76e321a950aeb32aafae3857aa3265dc16c1487989a5d84b598bf45d9"
+ "faf181a6130343e87f664ddc1b844302c2311515258c6e1b9a2d09b1eccccee59c2d69d2b5"
+ "1dadfa6e28db845fb8371184e72cc1ed9ad3d8b6db5eafa84895c8ae26fa99bf69787792b6"
+ "052eb6f1178de7d0a691a249aaa2545437fe89533c8c6aaaeff32d49cad1b6d41cf45a3b04"
+ "96fe7d1b177ba3ee3cd0415a3d1b81ce355fe18f9113a8628d9c057daaa0d1ec9f2c838589"
+ "a5b90774e5d55b7bb166806ae3ff2ee4027d8c8cb4d9c00b1b03d63add86212b87c3302cc4"
+ "9c9577c77a4f55b8f2c82189c6d3b63df882b473c2a17253add07ea88be17293429827d0dc"
+ "65071cf01c3ec3bb87df788f95ef3f5472c6e595c7629b1b7d7a27efc79b91ea8b348179af"
+ "e210ddfa00d7673beb345f13f39e455cba990056355f8634576f3f49e5937a90a8dabed519"
+ "dd045e95f471185c8bde7a27fe344b25ac6d97eed9a3ffc033900e025a38b72da43747dd06"
+ "c7f4ea8639b931f2852d8a3f60be3cdd74dea49e9fc303146e26e0af20cc7897e2a0bdacee"
+ "61187eb389d77060260502d276f541b71b98ffc04abf8e199aa53d831ba348e9820c2fbcf4"
+ "b07cc37008fae656db21ce91281ea5b389c75ed7c167c133e0bed82b40ba19e1f98be20b74"
+ "9266d185b8373b451768f8f1179950056086561c47fe3cb2e8b647f0fa5d511e3291cab566"
+ "b1ec0ffbccb7940e40c5b44a28c2fa9b7d100a05d4f59158b5dacc3cad1d6f054cb648ab7d"
+ "26db6126b26d011d1d982a63bc69804381b6ce05192b4996679962027e41c453fecfc41217"
+ "fd9e83c76cf1ff4151d9d32f209dc826c511a35dab3cf7252eb80ad9ce02290edc8de51c25"
+ "0ec5d874866b6389926dcdfd953ffafe8126a6b0582df5d5cf836002e41c04a9d6ee986ca5"
+ "a68fed99a57256d1401cd4b8ab19cc6fff65b328986dd30015e4c9f609510d6b93669aa2cc"
+ "13b9d457aa6c994007bbf00907935621f576c77ae91e8fe5b3f3f3040010e1921cb2087568"
+ "fe8fc74ba65295649bc97456be30b41b8f6576d5e9aa9bfa997ac307912bf074d70efa36df"
+ "5dc309d05625778f1ec83490f8524eb6f82de3f16363321d9e335a705cc4cd6e7f83d1428f"
+ "8b52e4d7998ac1de3a6956de0cde32b7231a5a96051a4de052263f5c14332f7f2cf585adeb"
+ "1ef6d4db6f963621da8e5baa50bc911b09264ba9c05e56976eaf1f749eed3380773797b8d2"
+ "d29d6bf9ea5ed0183e883d9815f0799b984207b893ebf438ef5226db72e1e74a56a83b5be7"
+ "ec28a8efbc18ccefe0f790dd9cbe6fd4e4576ddde67442e4da0a16245e973ee8c3c6b0cbb0"
+ "ccfb445be3eaf40c2e6c748af0496857ba0aebfd7c4abdcb7faf2d511c23ef6e33e63be6bd"
+ "db711b5fbadd579be403d06776fc5f9028bfe6c0adac730b0d728380434e80a2f85b01ff68"
+ "092f5780b701217866abcde23955d4513d76eb738e4e746a32862d5bf4a7e576dc5e0733a4"
+ "ea9ddf0080a5098d7f86af82ff52a14f9b8eeb85d03bf5a4856844b6a49db23403eb36647f"
+ "2123f86fe89f240be30e47207a74e509804d3201eb06c0a33746f4efd275a358a709777b8a"
+ "d85cde65a481cf7d52d3a48137d0e3f464e5b7083bb4d56639d0e5ca5ef91265e32e1d76c2"
+ "c318505f735762d33f8da0a5a0b2ff9a0538654fd7dae9d4795f0ce2cef620933972a90637"
+ "219764fa6dc342e69059dfc73dc29a7da6cc5f0466272cb4f42d46013be2dfe8bdac4d795a"
+ "89368f473eb7335a2101f64a5a07a5cf8fd7f66245b68a7e49c57d1a1e146aaa7f33859dfd"
+ "d1762846044e5f38e246716d51321c1040540259b41d9daad868cae75580c50e3810d20228"
+ "e7cedd1097b8f91104c20d057b821ee97fc9aacd7cc225fb62e86490d3a0ce7ea1554769f2"
+ "508673b27f7195a1b5cb4d2396cb008043c54edbf03c7033fe46f2e04ab4c9d9a33cd4941a"
+ "826169216b96af7ffe43b1b00433ce8e5d0892d518eef9b1315486661abddb7224bbc7e020"
+ "0d73aa1c677a66ed5e4e9e9c24083e9d6f1729c2544679cbcca14f99709d2cd4f92d79ec53"
+ "043f2194b21378971d4109df46c34cd662edd8f783ce05bfe634b3e6ebb2b6ea4fd93b3ed4"
+ "9011b00fda3661f7447185e3cbfe18a74eb6fc0d27cf52dd5b40106d458542b3fdb16debf4"
+ "b746549226b22b1d657c7d0ace25cd4ceee9cd91f868e7abcedfe12942c069e287f64679ab"
+ "9ae9018a2c1d39a1a67f6c9fa74fb52aba56f25b49528490a97f320cdc4f723d92d5d641f2"
+ "0d9d9809661707ef09e6fae3d855dd6d944fb9f596008426cde5b74176f94504adb0b99811"
+ "cfd49f7317d712656db9034bc03ceeb18bb5d84fb03c6c9843b2e0de64db7f0d170818a7d4"
+ "009226270e52f2148b827b3874054d014072b2d6fea3bf8d3391a212b87f729b14fb5cb2b2"
+ "af51c5a1198c68836d802c77df67eee5c03a1ef3ae76d1f362377a9497603439408ffd2ff8"
+ "bb14ba82fe9127ee636856bef4f15dd93a508cba2fa17b3edd83550f4f4b726dc5bd1d3c6a"
+ "c3116b13a32464b833463468a1290c2e80b2ddc8fc0259d71e16444a7949aa35ad482fc068"
+ "d5014dfee33075c27e9a8061dc76b142aae617ac05bed9ee847e26f41014336ed24e480e08"
+ "3544df22e5dca68e081d1ff2b3732208858d9f782fedabff8d3bc83242733169d3222403a3"
+ "72d9335146a6af07d7f75aff8b1d73f4a8423a517b5d0b4c390a780e10722965b9f74d5721"
+ "17d2986b54ddc54a6b58b7e7189c4d1293446d5325912a19672d68b7237db891cf59d0b6b8"
+ "9092161991eca1563df8b2e0f1881f4900d7a41d34ba55d55bc170e9069dcb73f61a6cacad"
+ "e21b4f20a7c25eb7d0fac2033f9a372805c755f99f6b838e556a45018d7a2bcd3d60dd583d"
+ "46f35d2553beac5928f5bf4f695c0b4d328854791c0b99bfbb9f9dba732eef4275e1f6a553"
+ "182ac6471650967ff83367ecdcb61f6bf67a77e617526c67dad885413738b00f3242948c5e"
+ "3a70ec4ef77db5867a0ca673eff3602b2f242f97e98ee946ef8f8b7684991b5c14a9d31011"
+ "b9aa4d3915d84ddd798c304776f4cb50f375f46459e4d637bf3b30258ea21a7e0fb6689ad2"
+ "5f814ddae78fdd88cc59824723b063175b9ead2f2612da72e7c458049e4b68ee04a409d5b2"
+ "6e7696a4f700a1c64fdb3164cec26fa673fbbf60f72c2bc717690bdfc575d595648468c5ad"
+ "848c627130d6ebb468159536ce59f9b6d62c772e9fa23ae4413c26e8d2f0a50c95f736c246"
+ "80cc0d8fe94b8674702a92929f464504aa2404f66e76331c0b08d2e31ee04ac9e99b695a0d"
+ "8799e52fac2e21c1928cfef8c08acc7c5959a9d42c7e038177f5d7f0f64ccd5b890498ff51"
+ "549be791874928b7f43d2982db3ad1bab48ecb757b51e12a9c6626871ff177abe783a94296"
+ "e5e37baecf5a376a5212556475262172c6afcddb3d8ca8041f7fe80868c846230ec31ab5db"
+ "78f2a92b39fca377fd0000631c95c512b090e87b2291ed912593259aae0198f2895f8ae769"
+ "04c103a79aaf777d96e7c999a6a2ee92dd17f3c06021545b5801c6c0a2e5788e285cca6380"
+ "5bdbf51a4c81a290cf1796c36c9e2f5944b227c6521f681d376670488931b89f24f79357a4"
+ "7bf4af9e2303659a5c623edbe472b7a4d1ad85ee60c3adfdd1a30f7f14c455d43510a15f21"
+ "20c0fe148707cf3e777ad2102c3381013d482e2dd2b68ced555ef58955f6293ac891ea6cc1"
+ "6607b6b51c16e54671960a3c1c00b1285696bd85c458a663dd9d638814ee65e71b77fa783f"
+ "78e175e2a880ee3093aba5bfc3ff0e5b6e1b6ab7ea4f184ecf11c6621e2187f0ba112d6036"
+ "4d95e2acebc75b9255d1e681476b55d5cb9d682519212dd03521c5d00b84b97a934877b574"
+ "ff4a180d777bc446e7584cbf5f0e8ba20f04a899f0c684dedbd7c87cb33642d1828e3bbaeb"
+ "8b4c077fca8fd08e460740daa26b2a924181db0e2103f08c3862e1fd23795eb530ca6589dc"
+ "90a1f2fb893743a495a4140bff2e7b49330e5ef5584ca5b395679f479ee3802632add5b660"
+ "3e14729ed8d13666ba6ecff0f10dcf30cb820143c8e3e07c96031bc42c81c9b63842e9fdb4"
+ "c248e246c758abb4e07ecd5c89b4376e371ee862a1a8f66ee5a2a464d9366bf1b381558079"
+ "59b8705e1890a9fa46c1cc54f7310a240c88b2c36f5b9db8e710b38510d1645ee8a4a4e0e8"
+ "b14c05892371a200dad579e14af518de70f0120fdafa14f5cd62f74467c4544660b094da9e"
+ "9e00a0cb1d7a7c382d30e75cc8c5517f5e02a68e67398e505a88998593152af5a96e09e718"
+ "b6e719b4631a4cb2f8d1f64a3c673ef01e640628383004da91f1045cf47c7e0d34b437d571"
+ "a68f40e2f6b4af1a00a2c83592b11c9a736ec23ff83479d9503a562571f3dfd9f2398bbedf"
+ "825af5bcf88bda170d915b11dbb2a3749ce6908cffc0ce7819b4f6ef60f6fb5b0210a29863"
+ "998aab74607a6fd818e4cf3a0143b61570186a98864ab65c288268817201431ab2637ccfe2"
+ "a977a725cb5fffebe5b481f531f0a6857c763c226f7fba39ec939580dd28965801d68eb8c3"
+ "1605341e85d22e68bd661652b0c8a3e64a0f469a7a16debb45dbd0edf47ff7d761f99255e7"
+ "ed9e3fdea5328e26bf5fcfa789b1c7f2cd3c9234c99c030b1db4071779bd2ebd7ad8d20023"
+ "00d94cde83293dc1fa698821f7c8792397835a599fe7d359e88906df7440a3edb4b9d6b285"
+ "7b0e6fdd0f1485862e2ff3244d7821719e72899eb5f5a0bcc413f634ebf4e5ea7798e09536"
+ "be917c6d6b97646873cd30bed56972fc3abdc042463a6a606be95b9d96b4484a53ef5d5b9a"
+ "11a52fa31e268df46551789f5b7f09dc2fa09e4a958fbb76c4503a48a8e0faa4ec422aa3e3"
+ "6776327726786e18bcc17a2ff0b58979b41e7f8da369a21927bba63dab179ce341073034e3"
+ "c50ae3bf27b25dc791479904d3dbb5c3a42f00da0b0f16a89578fad646c9f8c8f93776ecdf"
+ "eb71acb61a9a7cd3be74c0a3492c529ad76c9003fa781e57f8513d92cc5b2ed1cf69880e3e"
+ "45bd298e94aa174191f294cadcddd954c431d0dd7f045032005873d943ab7172a4bf64f382"
+ "c789f6a8ac0e5a3caebbf8fbf26cbbcd9d58970ca1b22157e7929c8517bf633d28946cec27"
+ "6aebdb0a638720a1e1cb382826e4cfaa5cce5a68572904567d0a1ac7cc6be9211126de62ff"
+ "49a2164b5e7a74d49ac1c385fd8d6f7880c4fcd5e173c5d215be1a3785d8025edb7a31c0f0"
+ "9b528918a48a083133e181df412777ecc9fef1693c7c19cb79d6943b4d58617cdc6e9cf83b"
+ "7562bf4b93a8b8fd865bacc383d552450fd1571e2eca6557a27270fe21975cedcccdab20a4"
+ "ff6a754b9a0502194aafbbbd738afd2fc3ed3ff5c6190ac6ffdffd494fe5f25e7cb4ff44a0"
+ "445bcaad32d9cfc2b58de9d1d53bcc6007617f0fc713eb5b5acbd6858c999b96dfb1b46da1"
+ "6a0fe11accde3b4e011614980cca78325599de8f93a6f8e4af4126993b1f940fac19f649fe"
+ "721474cac4d32227e92a2adab1b9ff9d1e5935f806d8721d09be737ac1b024eb67750c154e"
+ "61e6bdf8cabc98755fa16d3640e80b94e4e23deb3a36a2172da28dc9eeea3675be759de36b"
+ "ee0e951fd77d7aa68ae4caee0fc80175045595957fd00ea3ec4536e666a691efba0380d05c"
+ "0c88154b4ab67f34ea6c201b600da60ff8b46ceb971a663bcdf2ba0eef26095f3783b42c60"
+ "10dd3959df46c4d631e7a89e62f5391d6857b79f9e4502cb3862586a80a7f33576820f9985"
+ "eccea22b4534a5e121db3ed2e21a2d7a9dd80a624479bbb061b91c38ae5714ecc996e4b1ee"
+ "ea6498f1b5b7aa11d0475b591b8769dc10bcb405ca2a6c5de880c7c533272dd6e3bc9b13b9"
+ "e8705b549bb50e72da1e943a0c98d313e43eb847f4e8b79a549b5cc8992a59677a473f694a"
+ "3e94f4048e0fd7164772aae1056149dc9f747be8f59f365702f24222fe0f6f320de6345a3a"
+ "00677bcdcf1a99592c45076b049616db7b447c4fe3a7937febeb392c4baed841c4e96c7cb2"
+ "a63ea3322adbc2e88078b6d0f10c7b373cca2fe3ab24cf2bfb4c0bf253222ab49011cad073"
+ "23bfb8b554b513025e4f04a61fa2218b7f2e341fdf86633cf90fcef924f8175e30f3290cc7"
+ "bab09b7cf8bc574f7dcdac67d5c59436f6762ef35d4b1327fefaac7d575314acec5af01cd7"
+ "477e13de5ba16c9798a8868767fbb2633eb152cfd1c946b500090a43abbc4c322f5639f0a1"
+ "5e8d99573860a14960e36ea8cebd1eae0a15da0494a29f80cd4912b18dd6305a093409c7ac"
+ "796a3e6a8b5e15ac469cbd8e6f60d0549e4a31713bc639dc3754d857d2a97790b7487efbf2"
+ "99ad8259a31c45e64e0cbb464b1fe0b74c4a24fd1317363103252144820b45bc0702a756fa"
+ "6e89ab4166385106051713cb6ba5cc5b4dc92819cef9c33d27b9550eda8300e3583af8b10e"
+ "7f18501c59ec2f4563792e8cce5a68b261a9b961de92edee5e5a78c4e7bad2a2484e5bb46c"
+ "ef8b1ff7c0d111e012e5d295065398f99d85a9511f3dcff5fb2a7549b0934a3af06294e43c"
+ "d8d4d6c65fcce4dd86a673bdb9f3be3fe177215187d3514f10a387b7aa22d1368d0735b200"
+ "8ac19612fe39cd0ebaee1adba3c94cbebdb21855f0fc5d9484ef26bf7c85b7c92fd1b67531"
+ "3ec37086b7bd647c0cff49f39ec2f64838e0605fc5d423b0934a6a3ba1a5de2b32d8234269"
+ "f282f2abbdb546d1186d9986cccca90a4cc781a634d797d8c89efa7af57d8584ba8d6f9a32"
+ "f7d158a940b9c7bf74e232173a573cf42a38cc3ef85b5b838846aa8de09484df405c21fb1f"
+ "492a5e30376925e49cbac45feabe81d7c5451ed3d97a458866aaeb241cc3f1257903aa854d"
+ "ec01bbefaf65338bddb7af026b3afc91b38e09775676075d343935e6f04a3a7e11f4e1fc3a"
+ "1dcd064aad3adb7ed5ce42c0905d0be146601683b2a8ac6670fb05f4ae73c18460d3f17506"
+ "4de1ed3d61cc1378edb7b0d20b7ff8d14c228c9c597b8df4cb96c37e38561bfcebcade33a8"
+ "5c1ed148b69e5362427f86b020468fc72432d2f50e5bcd73c5bea6b4f44c2a09aa7bd2c2f9"
+ "adc85be963e0770cf2f5aa38e7f5de6bfc4fcc8498b09c815abb3d90aba39b849d1dc5e2b0"
+ "906481b888ec4b50d7169caf274f22848e35a405273aa58bd4de8b92db57914bd4d88644fa"
+ "e5a2673ba8b7ce95d0d798d88ab08a5dc53b78c0be8d8f4f8804195cb2b816258ec66bde39"
+ "e22a66ad5e14931ce4de9deb8aab0237cbec2abcca45a2feed085541982eaf663316c9710f"
+ "66ced3b0f8ba1bf69106967d013323b2656de0b93ca15f4895c8ff15a339315e25ba5fb252"
+ "14a503bb688fda76a5551ef529235c5ffa09611aa59598a47b4c8ce22aa49df7217950a74b"
+ "03a0e8a0ebd9424eb170d5277b573b223289cc520b467c834b4c53f1d4e5b574380ded24bb"
+ "59cd70ed0f905f15c798952d29f9ce3c8b4a04678a58842b6b3bfb7669e5a0f2a153e02001"
+ "a7b012548050699dda11fc95f026466062bde597fd61be5c32ebaa19075636f212ceb0ff46"
+ "122e4ab88be9439d4ec653f7599dcb0caa86f26469da9f9d537793f1b890d682a84464b4f2"
+ "6a5481bc12802684c1d73dba5f7acfc4451a213645c39e0b3c7c6681623ecf255bc6c75d59"
+ "4726ce1a7318bb3ddb80cddb77806cdde22b90fb1a998d931d596bc833dcd0764993ce42bf"
+ "b40befaa469aae29b2758d584fa4804551046fe36452cce20e26e9454c9bb20e7dd9b5f63e"
+ "e35bbf7c43f772f38cb3baa2bea11e9881a8c94cd5385b75611abe8dcd17b33a5dd1c9b928"
+ "41cc08cd032c91408b475a0ae8866d4b7eb005d5f2bb227f2298444db54e8af8ff5b6e08af"
+ "5e609429ecba4c4ab5faa9669378be9308c900d0f04e2c65f0327c3e41c574dae5f96dfd66"
+ "41b96cb8923ff9ed42060e2d089ebf0dceec2d386da7f98c2726a142e0527f47be4559e0c9"
+ "f555bc6d87737f93cc82b6dbf2ab73921c57c28c0340273e8daf79a9a1db2ca7c88fa4531b"
+ "4e4b89c27f5cc4f59255d5a92656c984e2041a2eaac1cbff11e1720fa3425f9c97ce2789c0"
+ "0c6eee26e07639f47a3f0798708b4f5e3feda3b35e45504f42ddb10ab545175d82060c5eba"
+ "b9ff97fe51e33860f3edfea8c38ec927ec15398f811a0995ba948a790278c0bd2c6a398fb8"
+ "43a2646a11e0600560f729e412859cd21e1325ed505f2d06b1f77f69306e689d1b0b91b7df"
+ "1b7d97d96609bbfec187bb7a93288b37cc96fb22ec72b0493f0a60f1e00858d056970e535c"
+ "e4803c135e97c999df22c34d2524913c7a70313bf3601b07e3fcf5a257b46a87f48d58e73f"
+ "ce9447a8d10353a55e8ddbd99178e8c93e3681b16543cbf12dae84c93083111b0dc89a4f19"
+ "dba14e0b5ecb7b9793336a1768da49f72befd65bf67e13255c703bb4b7f6c9c8304d0de149"
+ "01fac221603a39941f57d9201c506e8440dad927d1e9a1f0e28d986949bdc4dc700c1998f7"
+ "1641f7d7a335f4295abedafdbb71e1ac829402443b4953386c9302d141bb6cd9d218c66d26"
+ "6c460aca44a0c49f3fcd3347fb7bd0ff8858f2bd37efa64c73ca85b4830f0181079619aaeb"
+ "675bea0e15aa2afaa62d25a5a1b3d45573705986c1a8a67ca5be85b062e77685f69313d87b"
+ "a16bfa2cc2810fc3882313f640a1f1eb0ee759b8f52f89a2a9d5853bd24e7d09c150e4b294"
+ "d65ec1d246aceb217d5a0cba04673d3c70bb2630d914e513f4f6cf30ef82e6b8f43aa4e168"
+ "6c259c76f593a3dab623ca0440d90fd99e84ea49ff376f2e300f8628ea27a9dd57b4e44219"
+ "67d7d55945be9e75c06f2be4c96fbf1b2f379cfed2c7e28cc66b205fb87f3ecc6f81081253"
+ "65ba7443907fa9129be3abf3147b9be54f7c8dea7df51330078877a0974843eb6f0667969f"
+ "73b5a64b406459f6ba6b266ec8a0032be573ff5ae53637d9d343d41af68346d974681f4cb8"
+ "922b3cd1ebbf695ed46dab551a245675f82a8f53e178684ea4da62fd817d0a9fbadfc12df5"
+ "9d18f6373fb111f0d3f9712b98ff16611f8eabc59997d0f975b67c47daaedf03521eea6beb"
+ "3dd569be0e9d14af9a6eda4650fe712789a6d59b8388997e9e0a8f1b215b5bb327ac5b4984"
+ "e1513baf6053ad05bd4eec0162ba25b5a3f37a2219230b9f940f7337a047dc2b6f71267fcc"
+ "64e2fec49cba93405125b185987f3f96276067a51b71b0668aab901ed1957c9c752c628825"
+ "04c2c2a8f81551161a1b015e36db1fdcf9520c2c5fe02c8bde49e1e422dcc7d04ba746e3f3"
+ "442a2b9a2443579058eb91bf39575f7f03fdf8d8cfdbfa22095834356ca28eddd87e174ceb"
+ "958d21d3f6af03175334f2ac43c7385701e08da369bd8d73899874a06759fdd4d747250d65"
+ "9f1a4fdf9f82ae6615cb5bc093266b5f3629d066a9094923249199fb816dc6d4f9bcf84384"
+ "569fb6ce070ae60811af0e8d88ec983b9b00d492b3a28ac0c64aff11bb9054406b7eb464ab"
+ "9f29e0947329de4811aba7546aca0f35f24d93f701ce9b58fe6c0379ed182149913a599adb"
+ "ef2f7c57a40a7654503a520e07b29a8a9e398b34ac99b4d29a5c4aa2a61abe583489c304c2"
+ "a3b708d3beea806720a179a7fd20de94c24e87fe3dd3856ce5381cb4d1ccd33d1b5323bd48"
+ "f364f8c995a3f8ab098118f66f5f111c4efa9739b69be6f8a09ea4a88c6d24d5d9ab3bb595"
+ "0ecb7fc5f3f9c3c1aac7c89c95ca75931c64651f081181f182d3235dd726329f9ec43c8c2a"
+ "fa9d8ec5058b22ef627105d6dcad48158ec6e8ad202a6c2f034d37c022342fcaec10fc9800"
+ "51c3c3d5d014e58a2be79061a78811860bf2137ee1a1510d4e72f7029252ec8e1f691ddcb0"
+ "8cfa7ab971d1f7b6e20d7c012177eb0f3f6e4a1cab589ee85e09f4c27579f3ff52c09a416b"
+ "5c585b7e6a1b7424779734820eb93e66be93044d09ee8ca34126b47358244b5bc25299b69c"
+ "5d39ed2826de5cfb285981e2ea043cbfbc603ebf6c6a885f68edcff2f0cf4addf628ad5992"
+ "84a798f3ad659f36fae28cb16fcd439ffa5a69c516dff3dad3760f663fb7ba084bc3dc66d4"
+ "6b31f3120c57bf46f7a20c6b225e867977245b3acf75e2136c39fe744999b76dbf44152043"
+ "b7af96a3a0ed4463f6b1b61d5f07a1e0c395c0051656959767e654eb163f53b80026dd5b49"
+ "b90cdbf2ab50306a23287665afc61d7e4bf0d6d5ff4c6416c07d1ca8d6390c1a69084d408e"
+ "1cb35a3afa0bca0c9fe58344d7e992c23b05c22c6cf57349b90f523e7227becdb320f39255"
+ "c3ffbf8e43b20fbd1e898cd181c6abcef5456807bf2914766bc70fb406228ae3c7c23a64ae"
+ "42b3293e17bb4dd622052f433a65fa781c221187aedcfefa816cb040ba11647c785f64ba3a"
+ "1e2eadd17bc6f8eb7e2ba480da06b6606e6f4ede7f9fdaf26fe89cc7cdb0ec08f1c53ea273"
+ "6a83a53824d1f9d05022aba64e65a59f19e6713d60e7c64f5270befed0570ac245490c77ea"
+ "af2baa4165a8cd1b268458b634df1f38c20e79b20d1fa6453e9ceb74c447c53705fab82e7f"
+ "a23251e425215c1fd55818ddcf4449f58ec238ffb1a3cb24b53caaa8430f8b01a1cfd515d9"
+ "91c6547c165b34d3608bc117207480396338645097f84499296425333bb68bf39349c59d04"
+ "dca85341a816fabed09c2d42c601c1966ad4e2baf3eea257f75524e96798b9af773169cf95"
+ "0186968f5aec8fd5906e55c9486a70f44f5435b112a47a33b782f01b5a0dd26ebb6ebb95fa"
+ "0a83d02b444416e2a340f5bade3c76a9217f993d508d48d013737da2c6ed9af245a0877ea1"
+ "b50719b77d26eb1085cd2a418f7c04b9fc413629923aea6b7ecc795958b0ecfec3b820d5b5"
+ "ea6bd1f7cb1b555c2820165f01aa85c49343f7b7005b28a28bcad9bc77999207559b60295a"
+ "e2ed8b11702e14b98c0026712400ec219ff867dd78aa2637927c9921238165292ab08409be"
+ "a2bc683b00e771510fa0db6c956603313a985e2dd1f13d0aaa1f7331aac6b8a5d5b195e8a9"
+ "3f5d5a07e4ce064258e2049f6c4eb1efcd3a7d890d881dfb080e990927d93bea148b5e7645"
+ "7c1bdf2a73d364cc30b81345edf3dcb375c5cc5bcf34536ad0481f3669ed32cb1e9c0895a5"
+ "0d2542bdb135878a8fa4fec38d46f0e3c8f9b14738ff36865d29c94b31faf6119b479b8e2f"
+ "dc9e1c838b82605809c66b08576b97b7b5d90d4865c77201c678cdcf770a7db91f2070c17c"
+ "67d4327e4d7ced8e2a73285993b1a19fe3eab29154035e4cac04d0cfada92aa5963e785f8c"
+ "a20d77e9f7e65169db4d9196abfc76c70f520b41017313d7ff8c43d129134a0f265ff6f10f"
+ "ad88054ddf128680ac133315bdd91b00d92d026a0d692f80069bb45aede03f09622237bae8"
+ "ef09462a0bfc4bbdda430833702a8481d6eb028f111b7305d33f30c8558a7d270a3aa5610c"
+ "aa8bcb39867efce7a44b0595c556c0befe0899908b82af48c07106e30c667ecd75df0df03f"
+ "9a606f680afff7c1b12625177d3f829adc2e304a5b1bb6c8788b712ebb6759629857d243d9"
+ "57b8aa44369fe3eda0474827c60ba9a042879c9e5896b71b35aa19f8d6e5ef5e0f713ed302"
+ "b8f50bc1d9083b7fd28765c8206e774ff62a522949c56dbe738b99d9e9b2eee7fce9029a92"
+ "b7c21f31cb36fdb974d237c7641060105e77a6a6a0e61d3a60aa4f792622e897e89bf6809c"
+ "d9f72674ee4aab58e636200e0de7d08efabbcbba05e408b16d9b472f8b993e0d3b5b74c105"
+ "e171ed02150e3a9c4a95a8b5cee3d35788a45bf328e2018501b86e973300221be59787fb68"
+ "1064a6f2bbaa44aa4be578bb8fa3c24e0dfcd16f8da1bcf72b9ee98c86ab8fea3913f5f3fa"
+ "c6840cf705fc1e1b945047e7301efa976135fc0bdbdc2188d9911cbb2ca2cc99f0d62b1888"
+ "cfbdff94ebd6b1583ebc07ad468ff5ca600e28438cc89e5a7ba3fa97742e51c45eddee2c21"
+ "46c29f0fd3f8ef8e2e3be6ca727e1d35ccfc5539f372103ea30803779089fb811aaf517213"
+ "ea35fb33c0d4a2464f37f286be1804030d59bf53be9bbc11fbdfa9b2fee8deb60f6ac7d6b4"
+ "070f4d666235ee4dc314b85869f339333a1b3cff2eaec781ea6a07a2440bb035b75a00ee0a"
+ "7d42672f160604a2e372c3ced65d4a556412837c8038f6a93e4eecfbcb4408a42159e76625"
+ "3b2e0f443edfb3e6f098021eb7b030f6d0d4b20243222604ea84d81e03a0f7e63a447f9bd1"
+ "a3f26485bf69912e16dcfb0222c8c5d74e7166e1f899101c74abcf4fc0558b4ae26a2c0e08"
+ "e2dc20c91d2c9fbe835d44ff15a26c6b976fcece277e4ff9fe80c0a28d5bf40bc40af5f782"
+ "13476c0b6873fe734a066fda3eb350302d7206168dd61ee4de813c8ac65a3a48cb40ccc821"
+ "c8efa14ce9320e6f0de35b5e68735bab8d03ef1185799151bb5f8a3f4d956752aec525cc73"
+ "d187665a0027189cd895f01422e59abed3bba5b655828d4aff00d77c846ea690c18a5a3f2b"
+ "86fd9da63f095da01f3778107b640a2813197a3f7023d652b2865ea8e2f93398fafa2f9af9"
+ "0ee81a8d6eba0d6671951ae831f85bb510605caf3ef2550ed0ded1fb90061857dd26eded72"
+ "5fe4399711fb2d0178a386046db054259a44896fcb795961e283fcda0d13be9b390fdc71a3"
+ "e3aadbac44dc71b9086e4b204cae1b0fa06268bd73b746807fd4c0ece38fdf877c490cdc7f"
+ "b622c8ec94b374a3b739c013476ba680edf46739c981ab095c175acc045c445ae15b208637"
+ "b13b841eae64b9b571630dc82119547ceefbab3288fa224d73b572ab1ac600258dbb7711c3"
+ "2801723744a2f80902b46286d52665d368892de15e283f30a5e3fe1d36284ad42afeb58a7f"
+ "a9850d6afd277ce4709c716160521dfabc755803932fdac96c096606be2690af795f418ba1"
+ "a3fd1e5758f570d702be4855c76c8ffeb3cf31056b47ca5d7aa498fd83302e490c61b32c8d"
+ "3586f43ea5772ad98b724cc51e2337d4674f086f915556b69ecfb837e4586c84b147cfbea8"
+ "a6427fd5cef19750866fb59dbc669de92972052b651c8d4c2f7cad2db4e2690b23db7830c1"
+ "c20658fce756d74db87eb7b93020dfbc49b86fb1ca81291f337d4642a0b330665aa8f4087f"
+ "ee34d22b190639bd02cf126ad96a34f21957e92549e0d96f54d0b1aeb904c33ea8e6733f0f"
+ "42abc821451471293415c18d4e01c044a3b96f85850c73a26aa01a382e424350f85eb5007c"
+ "d23878fd90f21c0413eeca6337a0a1b7bebf8042fbb10c6b6f6469dcd61ac494bd3efb2d5f"
+ "fbfd5e5398920d5a13e84da91a1636ae862c95b2a4d99e8e62eb43a7ce89a543db8c942926"
+ "e48b08d33b89afb9582bf56e50c5cd9d64e9e733e9a47404217b51d8854872800edcfd5426"
+ "39385e1f66242e01f97fd3a97e201eb95d16305956e57a8f9adede23791b8ee2fa3b81db49"
+ "f56cd02fa900439c2bb8b9fa7c65ee662d415164f5930a7c65769156080b3cce889e103330"
+ "a9a7934962d5ef10e8577438524c484aeccf8f556975a2006cc4e7d7143165f2f771d77a64"
+ "06d2251b8dd659c8a42aebac5d8e5513bd0527f9b6f709714bd82cceda33a18a572d7b1f28"
+ "e998a96d4fb596f021f68215356439f40ad42282bf784b954bc4900860bc07f4452ccae599"
+ "5a27afc8535b5854c5305ff02af7b876879512071f6d7aa7eb5ed7d37c0e657c00962f3441"
+ "2b23a694e75a52a60fc7a861deec2f27ce4f323dce313b98dcd9c4d419985ad696c5f58361"
+ "392563e2b0a0f72ca286e9a5a044a32685a01e4ade75983f3e53f74f4e1022b82479269ef5"
+ "279ec1765955642c27aa83847e0b9c029b63da839835575820699af9a038b587a468e556d4"
+ "26601282fbe9be24e1b33d0e1bcab5c5398f3ac6b67889f4c99b40cfa906fc2cf002868c2f"
+ "3d6f3bc73b683bf210ee4a5f5281c416898ae4cd14ced66f51e1c48a08420d275c90c3d3c7"
+ "7ca4eb22fdc5df97ff81eb1adf987118b7fc6b501b8a2c7a9be1933ab3b6f651ae93141ff9"
+ "7de2fe9ad3fc3852df6c89b2959a0fbfca0b63a7cec988e7eddc256962d58c2916f17b4981"
+ "0fe5543a37b5d74b52fa3bbb5385b7a08ad38b99b80b4744d48aaab4075c7672a45736e3d3"
+ "8c58f827472ba8550dff056e919f439796ba9c905a5a1df24e93d40958e215c59edba0886f"
+ "5c9f8c8b05dba2f2c9d4e568555ea29018cef66b10ebbbf76cfbf6d72c1795402a70bed95a"
+ "c819b0f05431b2203355e77827c72fb5b0270b1817df07cd9c99a4df89f8cbec7a87ab59e6"
+ "3cfc554d19d1f38a29206d3e5e590de1e6e329c2585d215945e9397d6762d60e23992a450b"
+ "e389e03eccdc0901808be8ebc45051b32956a1189649f25c37a09287762f5f4a5c69c54867"
+ "d63159662c6d83cfdaa0a9ffd19b356ef4aaeae58d6c481b84ede83decbbc44717f6e0be29"
+ );
+ BOOST_CHECK_EQUAL(x, z);
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/shift.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/shift.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,57 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(left_shift1, int_type, IntTypes)
+{
+ int_type x("12");
+ x <<= 3;
+ const int_type y("96");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(left_shift2, int_type, IntTypes)
+{
+ int_type x("246556567891512374789511237456594795648912323213860000007849");
+ x <<= 2;
+ const int_type y(
+ "986226271566049499158044949826379182595649292855440000031396");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(left_shift3, int_type, IntTypes)
+{
+ int_type x("246556567891512374789511237456594795648912323213860000007849");
+ x <<= 99;
+ const int_type y(
+ "156273790638943927367154966864556037925514287264587565911690950563681284"
+ "261029491729498112");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(right_shift1, int_type, IntTypes)
+{
+ int_type x("246556567891512374789511237456594795648912323213860000007849");
+ x >>= 17;
+ int_type y(
+ "1881077330715273855510797404911764493171022973738555908");
+ BOOST_CHECK_EQUAL(x, y);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(right_shift2, int_type, IntTypes)
+{
+ int_type x("0");
+ x >>= 17;
+ BOOST_CHECK_EQUAL(x, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(right_shift3, int_type, IntTypes)
+{
+ int_type x("14222200");
+ x >>= 8;
+ BOOST_CHECK_EQUAL(x, "55555");
+}

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/sqr.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/sqr.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,234 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr1, int_type, IntTypes)
+{
+ int_type x("-123456789");
+ x *= x;
+ BOOST_CHECK_EQUAL(x, "15241578750190521");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr2, int_type, IntTypes)
+{
+ const int_type x("-123456789");
+ const int_type y = x * x;
+ BOOST_CHECK_EQUAL(y, "15241578750190521");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr3, int_type, IntTypes)
+{
+ const int_type x("-25");
+ const int_type y = x * x;
+ BOOST_CHECK_EQUAL(y, "625");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr4, int_type, IntTypes)
+{
+ const int_type x("300");
+ const int_type y = x * x;
+ const int_type z("90000");
+ BOOST_CHECK_EQUAL(y, z);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr5, int_type, IntTypes)
+{
+ const int_type x("2228218");
+ const int_type y = x * x;
+ BOOST_CHECK_EQUAL(y, "4964955455524");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr6, int_type, IntTypes)
+{
+ const int_type x("-999998000001");
+ const int_type y = x * x;
+ const int_type z("999996000005999996000001");
+ BOOST_CHECK_EQUAL(y, z);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr7, int_type, IntTypes)
+{
+ // this tests toom squaring and karatsuba squaring for 8, 16 and 32 bit
+ // digit_type
+ const int_type x(
+ "0x5004a2519b00503006126bb044af8930502951243994250616123426085258764a856336"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "9464098710748f27372836255355251ae330455ffaa58681216515eeff0330517814dd7487"
+ "34682745159208158750835203309620570274592666481348052963762094268695162425"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "5944107067ac5771a1662497b8b93cfe57291387313365462656674328aaaaaf9067287310"
+ "ea6863ec68378827380764363420573208101547102942bf05465397209378421688020320"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "18850320172906096781969070339129822281355221058882087466637338881223511228"
+ "63144016884857141834687376804878770495858121023810198067988560350169566260"
+ "59441070673981642057711662497893572913873133654626566743289483229067287310"
+ "35702406cff061642794728883255642074744145228324022219347019013411158803532"
+ "4599404120656564868354acc9369a42721979894500607265f042a53387791b3dd4784511"
+ "50227920502852884378111055ccff50357557404795594025600468996407045934090727"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "6ca63511429296727b70a852e1b21384d2c6dfc53380d13650a7354766a0abb81c2c92e927"
+ "22c85a2bfe8a1a81a664bc24b8b70c76c51a3d192e819d6990624f40e3585106aa07019a4c"
+ "1161e376c082748774c34b0bcb5391c0cb34ed8aa4a5b9cca4f682e6ff3748f82ee78a5636"
+ "08041078777870387730504addbc23489bdbd45615ca892497b8b93428a2f9871374491b5c"
+ "16863866837882738076436342057320810154710294295605465397209378421688020320"
+ "0fbcfe9b5dba53956c25b59f111f1923f82a4ab1c5ed5d807aa9812835b01243185be550c7"
+ "dc372be5d7480deb1fe9bdc06a7c19bf174e49b69c1efbe47860fc19dc6240ca1cc2de92c6"
+ "f4a7484aa5cb0a9dc76f988da983e5152a831c66db00327c8bf597fc7c6e00bf3d5a791470"
+ "f84c878148cc7020890befffaa4506cebbef9a3f7c67178f2");
+
+ const int_type y = x * x;
+
+ const int_type z(
+ "0x1902e5887a586c505ed49b0ef0db72e959da458fbfe7f7f1738b9da657ebc6b4f3eeda8f3"
+ "45f86a9439fb0a314af8a6d54e9002f6b9778bc217f31e1c2af869b890e50b105f2a6c8f6d4"
+ "d9f7ce008697c1ef9f6b1b3d58089517db9a209f0951f3843c9f5dd81da8082a4e79771c9fe"
+ "c7a967defed9c1d7229a9e6a78226389976caba3a3419a68d1376d7b67eb20136d1c47b480f"
+ "446428ec425ddeb779492e6e40c2318633e6783066d046486a419676066b0fcacf9c9da24ef"
+ "bb6ae2a639af668b9c732ed3ba74f4e73f28cffbc415d3a086decd149e1dd1f4265ede8666c"
+ "2963f2ef61b190fb094730110586e73afc7656f6e8e3188767ee075b98cceff2de2959b3c51"
+ "eb0cd03b5d277846536a3d5fa2baaff03d2ff90785581d170ad264d845d6e3522921afae94f"
+ "13eda75f99694a961beff0495830b53f1b282d4fc5fa665a402cc253d71aa411a16c7cf3825"
+ "6ff351d8e7f6c476d01ca3d39947a71703488cc0c85f7ce9ae7521e22ce4cb99e14dcaaaa69"
+ "d8f1390f8c8275c899e8ec14b2fb9100bd8c4e44bc2d531f049a31583e11d73070a815efad7"
+ "0e28caa18cd89a7e4bb1a17a961ae011511fe3ef495ae1c8e44653a73c6434ee77b242f7d9a"
+ "462613b92a5809da93c6d687222abf79b09a718fdf7787c7aff48b1e529da53898273abab56"
+ "00d67781a15c06e3741c79948cecbd3cd24414d40b0087844c9271bae8d470571a4e87309f9"
+ "ba510ef32c2def3e29f0f342f9a6f50fb00ee16159d0de74dfc85baf97c861a1ae63aca48b7"
+ "b2c3830ae11aa818f6da2a3cc74b5c2d0c635c9dd6d9fc5b9d35e46f8a53b93724e112a140e"
+ "cdee10eeaefa830d4678d06e1f3426abba1c9f76415ed479bee5160a8a5fcf9d5803552ca5a"
+ "810ea290fab7df557d9687af8782413fd04bf41454eae63c470ab231186c7aaf88b7e8de2ef"
+ "5e04cc8f9738f42ab5c8f993d13f8051765d4369709e54d24ec5e14138d1fe7ac81b311eb42"
+ "b0c35deebd10a3f5a60535870eeebd8662d11844ae4b39507232787d04e3c214e5b73b7b280"
+ "3395fd5a5c0c373cf2dbe76a2972e3bbaf6ff166c8134ad831ed000a4c4d5e615b74d697f8c"
+ "2be9fd8326e1aa352bcdb5ba460a0d34f750de03701e98ea43969c5b3b9de3e7bb562a320de"
+ "b10d1c8671b523611ffe7c2da353a1d3b86cf1c4d34d3347d02337e0656b9b39c8fe1f961f3"
+ "b5919df4469e895d3869590c042d6f881d9781c413613f6c5a22fd9cd24c906582e143b04b7"
+ "a09aefeed701bbf92687e995cc56578784b96c5a7a648d5c166c3b7c9a0c2df9c0166bf00b8"
+ "55c1f6e236ac96484638733eb9e84ccc4ccb33a49399e5057bd2d96ca51133496d5283a2085"
+ "56aa7f2b3264678f99f7cf5380bd61180230870ae35c00d272ec73d960ead550b29730a42a1"
+ "051e825890ec2283cf0de984af072a2125fd4ff692e47ef620b24a952c37ea379444061869c"
+ "aec75d2836afff972e54255daa9069f4c51f5bdb8ada41d3907fb5581dc7289d50577663616"
+ "464fc8b3f99676dd67bb93358a897feadd7a92336a0f4af44c9325fc53ba1d87f7b914e4847"
+ "462109cba84ad8498cd717c503d4c363b8ff405df44fa84bc9c8bed141c7f91954098b2ecb8"
+ "b59fc457ec86022bf6c395bb382f6a193e3387d52f3e1978af4576153fa7fb60d5b896cef43"
+ "e628045ec0577971b78e7ab1b3a9fa9ea6cc8e4a04f141e744f70fe0c800ce5dd3c748729c6"
+ "efa085877a7d9296ad489883ee966117e5db61bafbcd55284dc8d470646473761ec606357bb"
+ "fed899cd7c69e027656ef30b12e8a9e63868048bae95c7b67d26a843c94cec551ed5093542b"
+ "ff7437316a830e3c48f19491a81fb37aef5d89ee08b507b881e65fbf8dd3343e58b63ea3a2b"
+ "d465e02c5cb673e5c8cced17f5d3f9fad8307cd6c3abf9111e063fb197df4db52eac6092229"
+ "64e157a1b172004c1817162e688b55245c598cbdc5fd9f74db4911484feb5a390c27d0efeb3"
+ "a8bc21ff9dec02808fad5f882580facb5324a4f3a21b75c23cc311be7afe003895351fd07fa"
+ "c037d67718cc11aa5942837ee9048882e2564b625689ee3bd9487c4ec43f562508bbcd0671c"
+ "18434ca6ae92725d905210060d80e2524eb38ed600aeaf486d7b2b690a9f567d86444c35fd9"
+ "8bdf6b665dbf7e43557b281a792400274ca21fec996e5e6142780f8a7adcddbae4a2e9474a1"
+ "38931c19f96368bb2bc40aace10616bef5c975feca3c7f3e1122b41a39df9202a7a6405c647"
+ "d032f8c692e1e89838fc1dacb291d9e2d8ee90d88b6f598947d085289f9c4247548628a9e3f"
+ "6ea8ac5980e290749e39a9417b20f39dbbbed20209584a741747771020b2287007b37d17779"
+ "21303e3b7a9ee49db7b14dda965d9241548387e610758507c946eee0c49b67efaeedbe64e6b"
+ "114e3b4ddff5edd2050322d8298ae66388b1fb64435fa064364f41f129ce83a0cc563f8796e"
+ "1dd09be1a03bc5567caed9326df5714f6cf88ca247826ce93add7d17332d6870b1d0613a4fd"
+ "fd4c7d8185db385687d735d0bf22e87a045ad2a397db9c4ee0908a047f087a0fb49a27f65d0"
+ "e6e6ef0ef506d1411788ac027c29be3e93253e61ee76f951d3ce721c825bf5b883471f91f68"
+ "a37ca36d198adf93063e220a16b94e9aaca5c4691590ff2a696c1663b5ca69e3f3a11409cf9"
+ "727cf409a1f87a0a5e4805008c7488b7c9e23c42e33bfb0fab7e4f59e482ec50aa1b4d64996"
+ "4e7232c26acb75217ef1b200ebde38169d6ce7aeb2746aa29249d61af1e168a256e1848cb33"
+ "873c5457afd48194f77c786bcd8ce842605117c66b003abc05fb9b74869cc832c88df506e0e"
+ "79ebb0436443fb467269e42840a0486b3f35acca04b000876b9bf2c6a7f09ec6ff7ce198f8f"
+ "584e3e22b4a2e8279c1a043899fe0d2e5180ec1738b1cb23032374069b33a471fdd8e5f5be2"
+ "a4ff945697d9dc540878bc6a6704cb8b866914fbce94021bc2e6743dc7e160a8780912a90ff"
+ "732a81b060d97f777713881e9214474e1196ff13f07361385e19e5c5ffa24aa6b00f473cfd3"
+ "e71c42ed1c31eb9b5ec91635bf8c77e7aff696009da2163c7e1621bea9b30479a8e10906d3e"
+ "1ba06f3e64e776a62164238d18cebaf9684427fe8e5930fbd8892851c8cfa4e2c729558b909"
+ "a665f57919565d834fbebb0d64ba1721b083ca6fe55dab07546df6c1e60ab41f4836f64c27c"
+ "4f715764a472f01d947cbf8d3cd8e011129edecca4334b095edf3d37e27b7c30900eac3702c"
+ "3e09179a53462cda8dece1ecdda223d6cc32c9363f5123982b071367609b01bcfccfd4a0120"
+ "23b4dfacb5993d04434aac5a95e0192770206b4a3bdcb3a75013daedf68ed40cfca0e4bd802"
+ "4906ff8cc816d7bf556898545965b846f2b1dda3216d17d236e4ba5d2427ee799696c60297a"
+ "c720adacd63da47e2e3aeeb99c136e1b5de50cfe523823a87f94b1b4b8f6be2162ea40441dc"
+ "2f9af466c7642d0ef34429a986ae96e962e4a2cd9c12a41d71398ac03c990a15364c38a3bd9"
+ "af6605d1c9b807babd942bd66d2f6e4ccfaa2131354cf78aa09ffcec32258c9c3b53fbcc755"
+ "5bfeb11152332bef6420b08528d43f6865c5d53ade958d3b58dfe2f34391ea8d2d8fb35c32e"
+ "6a8f569d6cc9d456ff5b78fae829cc171f95f5389373a0dee3565a428237ec4e68b6e6efc3c"
+ "a5bd220699eb80bd498d2ea90d43b901881567e9c18898caea36334008b4a08e3e6cbda4e17"
+ "db7f5187d6f3284eca8c1a03faa28a2a23b27d560690642db0ea485e4be8c1c8b4441234f39"
+ "f31a6c9fe5cc7e50c777acd0746bbfb7399ee262a36a54a8ee25c334e503dcd6e00f7e9ac3a"
+ "80495156af9f9aaac62fe02c4c2373cc03d32c4be1b077d97f6167413661403a38b0df999d0"
+ "24701c5f17e5e5701cf9b9eccd9417af7637139473aab760b7ecafa863e7f049a6b98be603b"
+ "6bf0132b211b80123246c657cfdbb4b5dff7be43c364be943b5cdf03db86a6cd56a96187cb4"
+ "5b6acbf37383ca3fe7c9cc3b65a57c9ea6f4d686222801ce6d1463bb92ff5f2599619388660"
+ "99365474bbcba180f940ede8a02777bcf55d3549cfcd819aca8f055074d81af6472c3c9beaa"
+ "67b8f89066f1e02d1502aa13a4c872b9b1dc4e2a2b6d58eaa869c9e62a9f7e01efc2c87eb6a"
+ "9bc80d29c9c48a10edec1e5a799aeff2a580736525357ae40d677aa4fb6533c15b4afed1fde"
+ "f6e0e4c0a548c5be8751da42ffd8b409dcd77487437a16d769e232c95d0b780a46395ea0023"
+ "6cf19b1fafbda1c8c75aee09e06bcf0383816d0f9c364baa95a09fe2e2894693fc66166a16a"
+ "e152a24dfc5ca3646ce2cafe40a7ffbeb561ae4db74dc7ff045e85a9126a25152f0342d1f87"
+ "3ecb21bc411771eb7589f3df1be59fa97156ca5d3c93a7df10b90c525e25df36e7947614770"
+ "1f9ab2a368b179428ad005c7af2fb500fac032f0f1ff3f9694412d3c164fcc444075135fd9d"
+ "a58e2fab3ebf7b5fcaaf20256052e64b59c92db1cd3c2e0c2df41b06a540a754d349a284fa1"
+ "45a13795674240616f433d174fc67dda102db9e9e3bf23d4a8816ad130bca720ef707606206"
+ "7ab36f2061261981528dfdcaa3e21787f164e6ba318bb018f3974540ae8559790284852d31a"
+ "d8c77066f8620345f099606eced7f93e465b3a31a7b196b24e76a44d7ec6f597fb4a3a9a1a8"
+ "ba5611156e20c294b90cdde30166ee59c0c80936e992e5f3185c6396756194a7c8f1971a0b8"
+ "27477b2060dfe721fd0c2e725e25cc99d1227c6db9d5452dd70dbb0c2db67187a4e93c9bcfa"
+ "0049fad1289773ea6ffdcf6e6680a44cd577223b8f86eae3568ee5cd0b2f45a17f7b6d7531c"
+ "925e2c22b4004fd8e12ab70e2392e190dab556c0227b660cc226f5db558668bcb426a8153bc"
+ "32af18b8c7dbe3c2ad210300582f823fc5fd7aadc653c2c0b59b3e5362b158793485e56c7c4"
+ "c4");
+
+ BOOST_CHECK_EQUAL(y, z);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sqr8, int_type, IntTypes)
+{
+ const int_type x(
+ "-0x10ef8a70456e96e5d20ac502fce83ab3218dff7522c2d02088a667bc00eb467c18c5c91"
+ "17bedaf7d79b09357862f8a8eac280a29cfee813f0721484ca7b8010000000000000000000"
+ "00000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000");
+
+ const int_type y = x * x;
+
+ const int_type z(
+ "0x11ed171d12cb37289a825658ab14c26a6870e9895c9beff0e5a8c415c68d5bb7991c061e"
+ "99888c8c93d69f4a8aa8b2b4c81d63a1bba5e0191de7511edb701f7e0f4c337c5dbf8e57b6"
+ "54eaacb22f542e3ef3d3ca3d255a8bf76604ad5e4b32164949c50c4144377417897fdcad19"
+ "602dc396ac9c2ed00c9c5b22d8f70010000000000000000000000000000000000000000000"
+ "00000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00000000000000000000000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000");
+
+ BOOST_CHECK_EQUAL(y, z);
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/sub.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/sub.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,139 @@
+// Copyright Kevin Sopp 2008 - 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub_assign1, int_type, IntTypes)
+{
+ int_type x("0xf2378eeec78234932222111000000f");
+ x -= x;
+ BOOST_CHECK_EQUAL(x, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub1, int_type, IntTypes)
+{
+ const int_type x("123456");
+ const int_type y("987777");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "-864321");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub2, int_type, IntTypes)
+{
+ const int_type x("955588990000001");
+ const int_type y("9801");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "955588989990200");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub3, int_type, IntTypes)
+{
+ const int_type x("99999991");
+ const int_type y("987654321000123456789");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "-987654321000023456798");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub4, int_type, IntTypes)
+{
+ const int_type x(
+ "49144609407766890328547643707523663509662747376486271392344480900673178645"
+ "33198519112197059826509662943577383543858946941049753393431035706592040680"
+ "43848484065292542884106550381079282660840705126574766636237650938379223350"
+ "073087806800887586256085275775217219429527000017403144");
+ const int_type y(
+ "49144609407766890328547643707523663509662747376486271392344480900673178645"
+ "33198519112197059826509662943577383543858946941049753393431035706592040680"
+ "43848484065292542884106550381079282660840705126574766636237650938379223350"
+ "073087806800887586256085275775217219429527000017403144");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub5, int_type, IntTypes)
+{
+ const int_type x(
+ "21665907282124706187656074325458499695895652068822763794228458103499408841");
+ const int_type y(
+ "173087806800887586256085275775299999999889978789789");
+ const int_type z = x - y;
+ const int_type w(
+ "21665907282124706187655901237651698808309395983546988494228458213520619052");
+ BOOST_CHECK_EQUAL(z, w);
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub6, int_type, IntTypes)
+{
+ const int_type x("0xff");
+ const int_type y("0x1000ff0000000");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "-0x1000fefffff01");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub7, int_type, IntTypes)
+{
+ const int_type x("1000000");
+ const int_type y("-1000000");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "2000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub8, int_type, IntTypes)
+{
+ const int_type x("-1000000");
+ const int_type y("1000000");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "-2000000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub9, int_type, IntTypes)
+{
+ const int_type x("-123456789");
+ const int_type y("-123456789");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "0");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(sub10, int_type, IntTypes)
+{
+ const int_type x("-1000000");
+ const int_type y("-2500000");
+ const int_type z = x - y;
+ BOOST_CHECK_EQUAL(z, "1500000");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(decrement1, int_type, IntTypes)
+{
+ int_type x("0");
+ for (int i = 0; i < 10; ++i)
+ --x;
+ BOOST_CHECK_EQUAL(x, "-10");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(decrement2, int_type, IntTypes)
+{
+ int_type x("4");
+ for (int i = 0; i < 10; ++i)
+ --x;
+ BOOST_CHECK_EQUAL(x, "-6");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(decrement3, int_type, IntTypes)
+{
+ int_type x("-120");
+ for (int i = 0; i < 10; ++i)
+ --x;
+ BOOST_CHECK_EQUAL(x, "-130");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(decrement4, int_type, IntTypes)
+{
+ int_type x("130");
+ for (int i = 0; i < 10; ++i)
+ --x;
+ BOOST_CHECK_EQUAL(x, "120");
+}
+

Added: sandbox/mp_math/libs/mp_math/test/gmp_integer/swap.cpp
==============================================================================
--- (empty file)
+++ sandbox/mp_math/libs/mp_math/test/gmp_integer/swap.cpp 2009-06-27 12:09:30 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,58 @@
+// Copyright Kevin Sopp 2009.
+// 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)
+
+#include <boost/test/unit_test.hpp>
+#include "prerequisite.hpp"
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(swap1, int_type, IntTypes)
+{
+ int_type x("-0xabff23742384bf892734029323819048039");
+ int_type y("0x1fee55d048039");
+
+ boost::mp_math::swap(x, y);
+
+ BOOST_CHECK_EQUAL(x, "0x1fee55d048039");
+ BOOST_CHECK_EQUAL(y, "-0xabff23742384bf892734029323819048039");
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(swap2, int_type, IntTypes)
+{
+ int_type x("-0xabff23742384bf892734029323819048039");
+ int_type y("-0x1fee55d048039");
+
+ x.swap(y);
+
+ BOOST_CHECK_EQUAL(x, "-0x1fee55d048039");
+ BOOST_CHECK_EQUAL(y, "-0xabff23742384bf892734029323819048039");
+}
+
+#ifdef BOOST_HAS_RVALUE_REFS
+BOOST_AUTO_TEST_CASE_TEMPLATE(swap3, int_type, IntTypes)
+{
+ int_type x;
+ int_type y;
+
+ boost::mp_math::swap(int_type("-0x1fee55d048039"), x);
+ boost::mp_math::swap(y, int_type("-0x1fee55d048039"));
+
+ BOOST_CHECK_EQUAL(x, "-0x1fee55d048039");
+ BOOST_CHECK_EQUAL(y, "-0x1fee55d048039");
+}
+#endif
+
+#include <algorithm>
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(swap4, int_type, IntTypes)
+{
+ int_type x("-0xabff23742384bf892734029323819048039");
+ int_type y("0x1fee55d048039");
+
+ std::swap(x, y);
+
+ BOOST_CHECK_EQUAL(x, "0x1fee55d048039");
+ BOOST_CHECK_EQUAL(y, "-0xabff23742384bf892734029323819048039");
+}
+


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