boost/libs/multiprecision/test/test_arithmetic_cpp_int_3.cpp

30 lines
1.5 KiB
C++
Raw Normal View History

2018-01-12 21:47:58 +01:00
///////////////////////////////////////////////////////////////
// Copyright 2012 John Maddock. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
2021-10-05 21:37:46 +02:00
// LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
2018-01-12 21:47:58 +01:00
#include <boost/multiprecision/cpp_int.hpp>
#include "test_arithmetic.hpp"
template <unsigned MinBits, unsigned MaxBits, boost::multiprecision::cpp_integer_type SignType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
2021-10-05 21:37:46 +02:00
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>
{};
2018-01-12 21:47:58 +01:00
template <>
struct related_type<boost::multiprecision::cpp_int>
{
typedef boost::multiprecision::int256_t type;
};
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>
struct related_type<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ET> >
{
2021-10-05 21:37:46 +02:00
typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits / 2, MaxBits / 2, SignType, Checked, Allocator>, ET> type;
2018-01-12 21:47:58 +01:00
};
int main()
{
2021-10-05 21:37:46 +02:00
test<boost::multiprecision::uint1024_t>();
2018-01-12 21:47:58 +01:00
return boost::report_errors();
}