]>
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 | 4 | // LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt |
7c673cae | 5 | |
7c673cae FG |
6 | #include <boost/multiprecision/cpp_int.hpp> |
7 | ||
8 | #include "test_arithmetic.hpp" | |
9 | ||
1e59de90 TL |
10 | template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_integer_type SignType, class Allocator, boost::multiprecision::expression_template_option ET> |
11 | struct is_checked_cpp_int<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, boost::multiprecision::checked, Allocator>, ET> > : public std::integral_constant<bool, true> | |
92f5a8d4 | 12 | {}; |
7c673cae | 13 | |
1e59de90 TL |
14 | template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_integer_type SignType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates> |
15 | 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 | 16 | {}; |
7c673cae FG |
17 | |
18 | template <> | |
19 | struct related_type<boost::multiprecision::cpp_int> | |
20 | { | |
21 | typedef boost::multiprecision::int256_t type; | |
22 | }; | |
1e59de90 | 23 | 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 |
24 | struct related_type<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ET> > |
25 | { | |
92f5a8d4 | 26 | typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits / 2, MaxBits / 2, SignType, Checked, Allocator>, ET> type; |
7c673cae FG |
27 | }; |
28 | ||
29 | int main() | |
30 | { | |
31 | test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<31, 31, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> > >(); | |
32 | return boost::report_errors(); | |
33 | } |