1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright 2011 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_0.txt)
6 #ifndef BOOST_MATH_MP_TOMMATH_BACKEND_HPP
7 #define BOOST_MATH_MP_TOMMATH_BACKEND_HPP
9 #include <boost/multiprecision/number.hpp>
10 #include <boost/multiprecision/rational_adaptor.hpp>
11 #include <boost/multiprecision/detail/integer_ops.hpp>
12 #include <boost/math/special_functions/fpclassify.hpp>
13 #include <boost/cstdint.hpp>
14 #include <boost/scoped_array.hpp>
15 #include <boost/functional/hash_fwd.hpp>
21 namespace boost{ namespace multiprecision{ namespace backends{
25 inline void check_tommath_result(unsigned v)
29 BOOST_THROW_EXCEPTION(std::runtime_error(mp_error_to_string(v)));
37 void eval_multiply(tommath_int& t, const tommath_int& o);
38 void eval_add(tommath_int& t, const tommath_int& o);
42 typedef mpl::list<boost::int32_t, boost::long_long_type> signed_types;
43 typedef mpl::list<boost::uint32_t, boost::ulong_long_type> unsigned_types;
44 typedef mpl::list<long double> float_types;
48 detail::check_tommath_result(mp_init(&m_data));
50 tommath_int(const tommath_int& o)
52 detail::check_tommath_result(mp_init_copy(&m_data, const_cast< ::mp_int*>(&o.m_data)));
54 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
55 tommath_int(tommath_int&& o) BOOST_NOEXCEPT
60 tommath_int& operator = (tommath_int&& o)
62 mp_exch(&m_data, &o.m_data);
66 tommath_int& operator = (const tommath_int& o)
69 detail::check_tommath_result(mp_init(&m_data));
71 detail::check_tommath_result(mp_copy(const_cast< ::mp_int*>(&o.m_data), &m_data));
74 tommath_int& operator = (boost::ulong_long_type i)
77 detail::check_tommath_result(mp_init(&m_data));
78 boost::ulong_long_type mask = ((1uLL << std::numeric_limits<unsigned>::digits) - 1);
81 detail::check_tommath_result(mp_init(&t));
85 detail::check_tommath_result(mp_set_int(&t, static_cast<unsigned>(i & mask)));
87 detail::check_tommath_result(mp_mul_2d(&t, shift, &t));
88 detail::check_tommath_result((mp_add(&m_data, &t, &m_data)));
89 shift += std::numeric_limits<unsigned>::digits;
90 i >>= std::numeric_limits<unsigned>::digits;
95 tommath_int& operator = (boost::long_long_type i)
98 detail::check_tommath_result(mp_init(&m_data));
100 *this = boost::multiprecision::detail::unsigned_abs(i);
102 detail::check_tommath_result(mp_neg(&m_data, &m_data));
106 // Note that although mp_set_int takes an unsigned long as an argument
107 // it only sets the first 32-bits to the result, and ignores the rest.
108 // So use uint32_t as the largest type to pass to this function.
110 tommath_int& operator = (boost::uint32_t i)
113 detail::check_tommath_result(mp_init(&m_data));
114 detail::check_tommath_result((mp_set_int(&m_data, i)));
117 tommath_int& operator = (boost::int32_t i)
120 detail::check_tommath_result(mp_init(&m_data));
122 *this = boost::multiprecision::detail::unsigned_abs(i);
124 detail::check_tommath_result(mp_neg(&m_data, &m_data));
127 tommath_int& operator = (long double a)
134 detail::check_tommath_result(mp_init(&m_data));
137 detail::check_tommath_result(mp_set_int(&m_data, 0));
142 detail::check_tommath_result(mp_set_int(&m_data, 1));
146 BOOST_ASSERT(!(boost::math::isinf)(a));
147 BOOST_ASSERT(!(boost::math::isnan)(a));
151 detail::check_tommath_result(mp_set_int(&m_data, 0u));
153 detail::check_tommath_result(mp_init(&t));
157 static const int shift = std::numeric_limits<int>::digits - 1;
161 // extract int sized bits from f:
165 detail::check_tommath_result(mp_mul_2d(&m_data, shift, &m_data));
168 detail::check_tommath_result(mp_set_int(&t, static_cast<int>(term)));
169 detail::check_tommath_result(mp_add(&m_data, &t, &m_data));
173 detail::check_tommath_result(mp_set_int(&t, static_cast<int>(-term)));
174 detail::check_tommath_result(mp_sub(&m_data, &t, &m_data));
179 detail::check_tommath_result(mp_mul_2d(&m_data, e, &m_data));
183 detail::check_tommath_result(mp_div_2d(&m_data, -e, &m_data, &t2.data()));
188 tommath_int& operator = (const char* s)
191 // We don't use libtommath's own routine because it doesn't error check the input :-(
194 detail::check_tommath_result(mp_init(&m_data));
195 std::size_t n = s ? std::strlen(s) : 0;
196 *this = static_cast<boost::uint32_t>(0u);
207 if((n > 1) && ((s[1] == 'x') || (s[1] == 'X')))
221 if(radix == 8 || radix == 16)
223 unsigned shift = radix == 8 ? 3 : 4;
224 unsigned block_count = DIGIT_BIT / shift;
225 unsigned block_shift = shift * block_count;
226 boost::ulong_long_type val, block;
230 for(unsigned i = 0; (i < block_count); ++i)
232 if(*s >= '0' && *s <= '9')
234 else if(*s >= 'a' && *s <= 'f')
236 else if(*s >= 'A' && *s <= 'F')
242 BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected content found while parsing character string."));
248 // final shift is different:
249 block_shift = (i + 1) * shift;
253 detail::check_tommath_result(mp_mul_2d(&data(), block_shift, &data()));
255 data().dp[0] |= block;
262 // Base 10, we extract blocks of size 10^9 at a time, that way
263 // the number of multiplications is kept to a minimum:
264 boost::uint32_t block_mult = 1000000000;
267 boost::uint32_t block = 0;
268 for(unsigned i = 0; i < 9; ++i)
271 if(*s >= '0' && *s <= '9')
274 BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected character encountered in input."));
279 static const boost::uint32_t block_multiplier[9] = { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
280 block_mult = block_multiplier[i];
286 eval_multiply(*this, t);
296 std::string str(std::streamsize /*digits*/, std::ios_base::fmtflags f)const
298 BOOST_ASSERT(m_data.dp);
300 if((f & std::ios_base::oct) == std::ios_base::oct)
302 else if((f & std::ios_base::hex) == std::ios_base::hex)
305 // sanity check, bases 8 and 16 are only available for positive numbers:
307 if((base != 10) && m_data.sign)
308 BOOST_THROW_EXCEPTION(std::runtime_error("Formatted output in bases 8 or 16 is only available for positive numbers"));
310 detail::check_tommath_result(mp_radix_size(const_cast< ::mp_int*>(&m_data), base, &s));
311 boost::scoped_array<char> a(new char[s+1]);
312 detail::check_tommath_result(mp_toradix_n(const_cast< ::mp_int*>(&m_data), a.get(), base, s+1));
313 std::string result = a.get();
314 if((base != 10) && (f & std::ios_base::showbase))
316 int pos = result[0] == '-' ? 1 : 0;
317 const char* pp = base == 8 ? "0" : "0x";
318 result.insert(static_cast<std::string::size_type>(pos), pp);
320 if((f & std::ios_base::showpos) && (result[0] != '-'))
321 result.insert(static_cast<std::string::size_type>(0), 1, '+');
331 BOOST_ASSERT(m_data.dp);
332 mp_neg(&m_data, &m_data);
334 int compare(const tommath_int& o)const
336 BOOST_ASSERT(m_data.dp && o.m_data.dp);
337 return mp_cmp(const_cast< ::mp_int*>(&m_data), const_cast< ::mp_int*>(&o.m_data));
340 int compare(V v)const
343 tommath_int t(*this);
344 detail::check_tommath_result(mp_shrink(&t.data()));
350 BOOST_ASSERT(m_data.dp);
353 const ::mp_int& data()const
355 BOOST_ASSERT(m_data.dp);
358 void swap(tommath_int& o)BOOST_NOEXCEPT
360 mp_exch(&m_data, &o.data());
366 #define BOOST_MP_TOMMATH_BIT_OP_CHECK(x)\
368 BOOST_THROW_EXCEPTION(std::runtime_error("Bitwise operations on libtommath negative valued integers are disabled as they produce unpredictable results"))
370 int eval_get_sign(const tommath_int& val);
372 inline void eval_add(tommath_int& t, const tommath_int& o)
374 detail::check_tommath_result(mp_add(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
376 inline void eval_subtract(tommath_int& t, const tommath_int& o)
378 detail::check_tommath_result(mp_sub(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
380 inline void eval_multiply(tommath_int& t, const tommath_int& o)
382 detail::check_tommath_result(mp_mul(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
384 inline void eval_divide(tommath_int& t, const tommath_int& o)
386 using default_ops::eval_is_zero;
389 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
390 detail::check_tommath_result(mp_div(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data(), &temp.data()));
392 inline void eval_modulus(tommath_int& t, const tommath_int& o)
394 using default_ops::eval_is_zero;
396 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
397 bool neg = eval_get_sign(t) < 0;
398 bool neg2 = eval_get_sign(o) < 0;
399 detail::check_tommath_result(mp_mod(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
400 if((neg != neg2) && (eval_get_sign(t) != 0))
403 detail::check_tommath_result(mp_add(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
406 else if(neg && (t.compare(o) == 0))
412 inline void eval_left_shift(tommath_int& t, UI i)
414 detail::check_tommath_result(mp_mul_2d(&t.data(), static_cast<unsigned>(i), &t.data()));
417 inline void eval_right_shift(tommath_int& t, UI i)
419 using default_ops::eval_increment;
420 using default_ops::eval_decrement;
421 bool neg = eval_get_sign(t) < 0;
425 detail::check_tommath_result(mp_div_2d(&t.data(), static_cast<unsigned>(i), &t.data(), &d.data()));
430 inline void eval_left_shift(tommath_int& t, const tommath_int& v, UI i)
432 detail::check_tommath_result(mp_mul_2d(const_cast< ::mp_int*>(&v.data()), static_cast<unsigned>(i), &t.data()));
436 inline void eval_right_shift(tommath_int& t, const tommath_int& v, UI i)
439 detail::check_tommath_result(mp_div_2d(const_cast< ::mp_int*>(&v.data()), static_cast<unsigned long>(i), &t.data(), &d.data()));
442 inline void eval_bitwise_and(tommath_int& result, const tommath_int& v)
444 BOOST_MP_TOMMATH_BIT_OP_CHECK(result);
445 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
446 detail::check_tommath_result(mp_and(&result.data(), const_cast< ::mp_int*>(&v.data()), &result.data()));
449 inline void eval_bitwise_or(tommath_int& result, const tommath_int& v)
451 BOOST_MP_TOMMATH_BIT_OP_CHECK(result);
452 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
453 detail::check_tommath_result(mp_or(&result.data(), const_cast< ::mp_int*>(&v.data()), &result.data()));
456 inline void eval_bitwise_xor(tommath_int& result, const tommath_int& v)
458 BOOST_MP_TOMMATH_BIT_OP_CHECK(result);
459 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
460 detail::check_tommath_result(mp_xor(&result.data(), const_cast< ::mp_int*>(&v.data()), &result.data()));
463 inline void eval_add(tommath_int& t, const tommath_int& p, const tommath_int& o)
465 detail::check_tommath_result(mp_add(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
467 inline void eval_subtract(tommath_int& t, const tommath_int& p, const tommath_int& o)
469 detail::check_tommath_result(mp_sub(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
471 inline void eval_multiply(tommath_int& t, const tommath_int& p, const tommath_int& o)
473 detail::check_tommath_result(mp_mul(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
475 inline void eval_divide(tommath_int& t, const tommath_int& p, const tommath_int& o)
477 using default_ops::eval_is_zero;
480 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
481 detail::check_tommath_result(mp_div(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data(), &d.data()));
483 inline void eval_modulus(tommath_int& t, const tommath_int& p, const tommath_int& o)
485 using default_ops::eval_is_zero;
487 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
488 bool neg = eval_get_sign(p) < 0;
489 bool neg2 = eval_get_sign(o) < 0;
490 detail::check_tommath_result(mp_mod(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
491 if((neg != neg2) && (eval_get_sign(t) != 0))
494 detail::check_tommath_result(mp_add(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
497 else if(neg && (t.compare(o) == 0))
503 inline void eval_bitwise_and(tommath_int& result, const tommath_int& u, const tommath_int& v)
505 BOOST_MP_TOMMATH_BIT_OP_CHECK(u);
506 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
507 detail::check_tommath_result(mp_and(const_cast< ::mp_int*>(&u.data()), const_cast< ::mp_int*>(&v.data()), &result.data()));
510 inline void eval_bitwise_or(tommath_int& result, const tommath_int& u, const tommath_int& v)
512 BOOST_MP_TOMMATH_BIT_OP_CHECK(u);
513 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
514 detail::check_tommath_result(mp_or(const_cast< ::mp_int*>(&u.data()), const_cast< ::mp_int*>(&v.data()), &result.data()));
517 inline void eval_bitwise_xor(tommath_int& result, const tommath_int& u, const tommath_int& v)
519 BOOST_MP_TOMMATH_BIT_OP_CHECK(u);
520 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
521 detail::check_tommath_result(mp_xor(const_cast< ::mp_int*>(&u.data()), const_cast< ::mp_int*>(&v.data()), &result.data()));
524 inline void eval_complement(tommath_int& result, const tommath_int& u)
527 // Although this code works, it doesn't really do what the user might expect....
528 // and it's hard to see how it ever could. Disabled for now:
531 for(int i = 0; i < result.data().used; ++i)
533 result.data().dp[i] = MP_MASK & ~(result.data().dp[i]);
536 // We now need to pad out the left of the value with 1's to round up to a whole number of
537 // CHAR_BIT * sizeof(mp_digit) units. Otherwise we'll end up with a very strange number of
540 unsigned shift = result.data().used * DIGIT_BIT; // How many bits we're actually using
541 // How many bits we actually need, reduced by one to account for a mythical sign bit:
542 int padding = result.data().used * std::numeric_limits<mp_digit>::digits - shift - 1;
543 while(padding >= std::numeric_limits<mp_digit>::digits)
544 padding -= std::numeric_limits<mp_digit>::digits;
546 // Create a mask providing the extra bits we need and add to result:
548 mask = static_cast<boost::long_long_type>((1u << padding) - 1);
549 eval_left_shift(mask, shift);
553 inline bool eval_is_zero(const tommath_int& val)
555 return mp_iszero(&val.data());
557 inline int eval_get_sign(const tommath_int& val)
559 return mp_iszero(&val.data()) ? 0 : SIGN(&val.data()) ? -1 : 1;
562 inline void eval_convert_to(A* result, const tommath_int& val)
564 *result = boost::lexical_cast<A>(val.str(0, std::ios_base::fmtflags(0)));
566 inline void eval_convert_to(char* result, const tommath_int& val)
568 *result = static_cast<char>(boost::lexical_cast<int>(val.str(0, std::ios_base::fmtflags(0))));
570 inline void eval_convert_to(unsigned char* result, const tommath_int& val)
572 *result = static_cast<unsigned char>(boost::lexical_cast<unsigned>(val.str(0, std::ios_base::fmtflags(0))));
574 inline void eval_convert_to(signed char* result, const tommath_int& val)
576 *result = static_cast<signed char>(boost::lexical_cast<int>(val.str(0, std::ios_base::fmtflags(0))));
578 inline void eval_abs(tommath_int& result, const tommath_int& val)
580 detail::check_tommath_result(mp_abs(const_cast< ::mp_int*>(&val.data()), &result.data()));
582 inline void eval_gcd(tommath_int& result, const tommath_int& a, const tommath_int& b)
584 detail::check_tommath_result(mp_gcd(const_cast< ::mp_int*>(&a.data()), const_cast< ::mp_int*>(&b.data()), const_cast< ::mp_int*>(&result.data())));
586 inline void eval_lcm(tommath_int& result, const tommath_int& a, const tommath_int& b)
588 detail::check_tommath_result(mp_lcm(const_cast< ::mp_int*>(&a.data()), const_cast< ::mp_int*>(&b.data()), const_cast< ::mp_int*>(&result.data())));
590 inline void eval_powm(tommath_int& result, const tommath_int& base, const tommath_int& p, const tommath_int& m)
592 if(eval_get_sign(p) < 0)
594 BOOST_THROW_EXCEPTION(std::runtime_error("powm requires a positive exponent."));
596 detail::check_tommath_result(mp_exptmod(const_cast< ::mp_int*>(&base.data()), const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&m.data()), &result.data()));
600 inline void eval_qr(const tommath_int& x, const tommath_int& y,
601 tommath_int& q, tommath_int& r)
603 detail::check_tommath_result(mp_div(const_cast< ::mp_int*>(&x.data()), const_cast< ::mp_int*>(&y.data()), &q.data(), &r.data()));
606 inline unsigned eval_lsb(const tommath_int& val)
608 int c = eval_get_sign(val);
611 BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
615 BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
617 return mp_cnt_lsb(const_cast< ::mp_int*>(&val.data()));
620 inline unsigned eval_msb(const tommath_int& val)
622 int c = eval_get_sign(val);
625 BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
629 BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
631 return mp_count_bits(const_cast< ::mp_int*>(&val.data())) - 1;
634 template <class Integer>
635 inline typename enable_if<is_unsigned<Integer>, Integer>::type eval_integer_modulus(const tommath_int& x, Integer val)
637 static const mp_digit m = (static_cast<mp_digit>(1) << DIGIT_BIT) - 1;
641 detail::check_tommath_result(mp_mod_d(const_cast< ::mp_int*>(&x.data()), static_cast<mp_digit>(val), &d));
646 return default_ops::eval_integer_modulus(x, val);
649 template <class Integer>
650 inline typename enable_if<is_signed<Integer>, Integer>::type eval_integer_modulus(const tommath_int& x, Integer val)
652 return eval_integer_modulus(x, boost::multiprecision::detail::unsigned_abs(val));
655 inline std::size_t hash_value(const tommath_int& val)
657 std::size_t result = 0;
658 std::size_t len = val.data().used;
659 for(std::size_t i = 0; i < len; ++i)
660 boost::hash_combine(result, val.data().dp[i]);
661 boost::hash_combine(result, val.data().sign);
665 } // namespace backends
667 using boost::multiprecision::backends::tommath_int;
670 struct number_category<tommath_int> : public mpl::int_<number_kind_integer>{};
672 typedef number<tommath_int > tom_int;
673 typedef rational_adaptor<tommath_int> tommath_rational;
674 typedef number<tommath_rational> tom_rational;
680 template<boost::multiprecision::expression_template_option ExpressionTemplates>
681 class numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >
683 typedef boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> number_type;
685 BOOST_STATIC_CONSTEXPR bool is_specialized = true;
687 // Largest and smallest numbers are bounded only by available memory, set
690 static number_type (min)()
692 return number_type();
694 static number_type (max)()
696 return number_type();
698 static number_type lowest() { return (min)(); }
699 BOOST_STATIC_CONSTEXPR int digits = INT_MAX;
700 BOOST_STATIC_CONSTEXPR int digits10 = (INT_MAX / 1000) * 301L;
701 BOOST_STATIC_CONSTEXPR int max_digits10 = digits10 + 3;
702 BOOST_STATIC_CONSTEXPR bool is_signed = true;
703 BOOST_STATIC_CONSTEXPR bool is_integer = true;
704 BOOST_STATIC_CONSTEXPR bool is_exact = true;
705 BOOST_STATIC_CONSTEXPR int radix = 2;
706 static number_type epsilon() { return number_type(); }
707 static number_type round_error() { return number_type(); }
708 BOOST_STATIC_CONSTEXPR int min_exponent = 0;
709 BOOST_STATIC_CONSTEXPR int min_exponent10 = 0;
710 BOOST_STATIC_CONSTEXPR int max_exponent = 0;
711 BOOST_STATIC_CONSTEXPR int max_exponent10 = 0;
712 BOOST_STATIC_CONSTEXPR bool has_infinity = false;
713 BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = false;
714 BOOST_STATIC_CONSTEXPR bool has_signaling_NaN = false;
715 BOOST_STATIC_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
716 BOOST_STATIC_CONSTEXPR bool has_denorm_loss = false;
717 static number_type infinity() { return number_type(); }
718 static number_type quiet_NaN() { return number_type(); }
719 static number_type signaling_NaN() { return number_type(); }
720 static number_type denorm_min() { return number_type(); }
721 BOOST_STATIC_CONSTEXPR bool is_iec559 = false;
722 BOOST_STATIC_CONSTEXPR bool is_bounded = false;
723 BOOST_STATIC_CONSTEXPR bool is_modulo = false;
724 BOOST_STATIC_CONSTEXPR bool traps = false;
725 BOOST_STATIC_CONSTEXPR bool tinyness_before = false;
726 BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero;
729 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
731 template <boost::multiprecision::expression_template_option ExpressionTemplates>
732 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::digits;
733 template <boost::multiprecision::expression_template_option ExpressionTemplates>
734 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::digits10;
735 template <boost::multiprecision::expression_template_option ExpressionTemplates>
736 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::max_digits10;
737 template <boost::multiprecision::expression_template_option ExpressionTemplates>
738 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_signed;
739 template <boost::multiprecision::expression_template_option ExpressionTemplates>
740 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_integer;
741 template <boost::multiprecision::expression_template_option ExpressionTemplates>
742 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_exact;
743 template <boost::multiprecision::expression_template_option ExpressionTemplates>
744 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::radix;
745 template <boost::multiprecision::expression_template_option ExpressionTemplates>
746 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::min_exponent;
747 template <boost::multiprecision::expression_template_option ExpressionTemplates>
748 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::min_exponent10;
749 template <boost::multiprecision::expression_template_option ExpressionTemplates>
750 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::max_exponent;
751 template <boost::multiprecision::expression_template_option ExpressionTemplates>
752 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::max_exponent10;
753 template <boost::multiprecision::expression_template_option ExpressionTemplates>
754 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_infinity;
755 template <boost::multiprecision::expression_template_option ExpressionTemplates>
756 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_quiet_NaN;
757 template <boost::multiprecision::expression_template_option ExpressionTemplates>
758 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_signaling_NaN;
759 template <boost::multiprecision::expression_template_option ExpressionTemplates>
760 BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_denorm;
761 template <boost::multiprecision::expression_template_option ExpressionTemplates>
762 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_denorm_loss;
763 template <boost::multiprecision::expression_template_option ExpressionTemplates>
764 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_iec559;
765 template <boost::multiprecision::expression_template_option ExpressionTemplates>
766 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_bounded;
767 template <boost::multiprecision::expression_template_option ExpressionTemplates>
768 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_modulo;
769 template <boost::multiprecision::expression_template_option ExpressionTemplates>
770 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::traps;
771 template <boost::multiprecision::expression_template_option ExpressionTemplates>
772 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::tinyness_before;
773 template <boost::multiprecision::expression_template_option ExpressionTemplates>
774 BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::round_style;