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