]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /////////////////////////////////////////////////////////////// |
2 | // Copyright 2012 John Maddock. Distributed under the Boost | |
3 | // Software License, Version 1.0. (See accompanying file | |
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_ | |
5 | ||
7c673cae FG |
6 | #include <boost/multiprecision/cpp_int.hpp> |
7 | ||
8 | #include "test_arithmetic.hpp" | |
9 | ||
10 | template <unsigned MinBits, unsigned MaxBits, boost::multiprecision::cpp_integer_type SignType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates> | |
11 | struct is_twos_complement_integer<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, boost::multiprecision::checked, Allocator>, ExpressionTemplates> > : public boost::mpl::false_ {}; | |
12 | ||
13 | template <> | |
14 | struct related_type<boost::multiprecision::cpp_int> | |
15 | { | |
16 | typedef boost::multiprecision::int256_t type; | |
17 | }; | |
18 | template <unsigned MinBits, unsigned MaxBits, boost::multiprecision::cpp_integer_type SignType, boost::multiprecision::cpp_int_check_type Checked, class Allocator, boost::multiprecision::expression_template_option ET> | |
19 | struct related_type<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ET> > | |
20 | { | |
21 | typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits/2, MaxBits/2, SignType, Checked, Allocator>, ET> type; | |
22 | }; | |
23 | ||
24 | int main() | |
25 | { | |
26 | test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>, boost::multiprecision::et_off> >(); | |
27 | return boost::report_errors(); | |
28 | } | |
29 |