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>
22 namespace boost { namespace multiprecision {
27 inline void check_tommath_result(unsigned v)
31 BOOST_THROW_EXCEPTION(std::runtime_error(mp_error_to_string(v)));
39 void eval_multiply(tommath_int& t, const tommath_int& o);
40 void eval_add(tommath_int& t, const tommath_int& o);
44 typedef mpl::list<boost::int32_t, boost::long_long_type> signed_types;
45 typedef mpl::list<boost::uint32_t, boost::ulong_long_type> unsigned_types;
46 typedef mpl::list<long double> float_types;
50 detail::check_tommath_result(mp_init(&m_data));
52 tommath_int(const tommath_int& o)
54 detail::check_tommath_result(mp_init_copy(&m_data, const_cast< ::mp_int*>(&o.m_data)));
56 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
57 tommath_int(tommath_int&& o) BOOST_NOEXCEPT
62 tommath_int& operator=(tommath_int&& o)
64 mp_exch(&m_data, &o.m_data);
68 tommath_int& operator=(const tommath_int& o)
71 detail::check_tommath_result(mp_init(&m_data));
73 detail::check_tommath_result(mp_copy(const_cast< ::mp_int*>(&o.m_data), &m_data));
76 tommath_int& operator=(boost::ulong_long_type i)
79 detail::check_tommath_result(mp_init(&m_data));
80 boost::ulong_long_type mask = ((1uLL << std::numeric_limits<unsigned>::digits) - 1);
83 detail::check_tommath_result(mp_init(&t));
87 detail::check_tommath_result(mp_set_int(&t, static_cast<unsigned>(i & mask)));
89 detail::check_tommath_result(mp_mul_2d(&t, shift, &t));
90 detail::check_tommath_result((mp_add(&m_data, &t, &m_data)));
91 shift += std::numeric_limits<unsigned>::digits;
92 i >>= std::numeric_limits<unsigned>::digits;
97 tommath_int& operator=(boost::long_long_type i)
100 detail::check_tommath_result(mp_init(&m_data));
102 *this = boost::multiprecision::detail::unsigned_abs(i);
104 detail::check_tommath_result(mp_neg(&m_data, &m_data));
108 // Note that although mp_set_int takes an unsigned long as an argument
109 // it only sets the first 32-bits to the result, and ignores the rest.
110 // So use uint32_t as the largest type to pass to this function.
112 tommath_int& operator=(boost::uint32_t i)
115 detail::check_tommath_result(mp_init(&m_data));
116 detail::check_tommath_result((mp_set_int(&m_data, i)));
119 tommath_int& operator=(boost::int32_t i)
122 detail::check_tommath_result(mp_init(&m_data));
124 *this = boost::multiprecision::detail::unsigned_abs(i);
126 detail::check_tommath_result(mp_neg(&m_data, &m_data));
129 tommath_int& operator=(long double a)
136 detail::check_tommath_result(mp_init(&m_data));
140 detail::check_tommath_result(mp_set_int(&m_data, 0));
146 detail::check_tommath_result(mp_set_int(&m_data, 1));
150 BOOST_ASSERT(!(boost::math::isinf)(a));
151 BOOST_ASSERT(!(boost::math::isnan)(a));
155 detail::check_tommath_result(mp_set_int(&m_data, 0u));
157 detail::check_tommath_result(mp_init(&t));
161 static const int shift = std::numeric_limits<int>::digits - 1;
165 // extract int sized bits from f:
169 detail::check_tommath_result(mp_mul_2d(&m_data, shift, &m_data));
172 detail::check_tommath_result(mp_set_int(&t, static_cast<int>(term)));
173 detail::check_tommath_result(mp_add(&m_data, &t, &m_data));
177 detail::check_tommath_result(mp_set_int(&t, static_cast<int>(-term)));
178 detail::check_tommath_result(mp_sub(&m_data, &t, &m_data));
183 detail::check_tommath_result(mp_mul_2d(&m_data, e, &m_data));
187 detail::check_tommath_result(mp_div_2d(&m_data, -e, &m_data, &t2.data()));
192 tommath_int& operator=(const char* s)
195 // We don't use libtommath's own routine because it doesn't error check the input :-(
198 detail::check_tommath_result(mp_init(&m_data));
199 std::size_t n = s ? std::strlen(s) : 0;
200 *this = static_cast<boost::uint32_t>(0u);
203 if (n && (*s == '-'))
209 if (n && (*s == '0'))
211 if ((n > 1) && ((s[1] == 'x') || (s[1] == 'X')))
225 if (radix == 8 || radix == 16)
227 unsigned shift = radix == 8 ? 3 : 4;
228 unsigned block_count = DIGIT_BIT / shift;
229 unsigned block_shift = shift * block_count;
230 boost::ulong_long_type val, block;
234 for (unsigned i = 0; (i < block_count); ++i)
236 if (*s >= '0' && *s <= '9')
238 else if (*s >= 'a' && *s <= 'f')
240 else if (*s >= 'A' && *s <= 'F')
246 BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected content found while parsing character string."));
252 // final shift is different:
253 block_shift = (i + 1) * shift;
257 detail::check_tommath_result(mp_mul_2d(&data(), block_shift, &data()));
259 data().dp[0] |= block;
266 // Base 10, we extract blocks of size 10^9 at a time, that way
267 // the number of multiplications is kept to a minimum:
268 boost::uint32_t block_mult = 1000000000;
271 boost::uint32_t block = 0;
272 for (unsigned i = 0; i < 9; ++i)
275 if (*s >= '0' && *s <= '9')
278 BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected character encountered in input."));
283 static const boost::uint32_t block_multiplier[9] = {10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
284 block_mult = block_multiplier[i];
290 eval_multiply(*this, t);
300 std::string str(std::streamsize /*digits*/, std::ios_base::fmtflags f) const
302 BOOST_ASSERT(m_data.dp);
304 if ((f & std::ios_base::oct) == std::ios_base::oct)
306 else if ((f & std::ios_base::hex) == std::ios_base::hex)
309 // sanity check, bases 8 and 16 are only available for positive numbers:
311 if ((base != 10) && m_data.sign)
312 BOOST_THROW_EXCEPTION(std::runtime_error("Formatted output in bases 8 or 16 is only available for positive numbers"));
314 detail::check_tommath_result(mp_radix_size(const_cast< ::mp_int*>(&m_data), base, &s));
315 boost::scoped_array<char> a(new char[s + 1]);
316 detail::check_tommath_result(mp_toradix_n(const_cast< ::mp_int*>(&m_data), a.get(), base, s + 1));
317 std::string result = a.get();
318 if (f & std::ios_base::uppercase)
319 for (size_t i = 0; i < result.length(); ++i)
320 result[i] = std::toupper(result[i]);
321 if ((base != 10) && (f & std::ios_base::showbase))
323 int pos = result[0] == '-' ? 1 : 0;
324 const char* pp = base == 8 ? "0" : (f & std::ios_base::uppercase) ? "0X" : "0x";
325 result.insert(static_cast<std::string::size_type>(pos), pp);
327 if ((f & std::ios_base::showpos) && (result[0] != '-'))
328 result.insert(static_cast<std::string::size_type>(0), 1, '+');
338 BOOST_ASSERT(m_data.dp);
339 mp_neg(&m_data, &m_data);
341 int compare(const tommath_int& o) const
343 BOOST_ASSERT(m_data.dp && o.m_data.dp);
344 return mp_cmp(const_cast< ::mp_int*>(&m_data), const_cast< ::mp_int*>(&o.m_data));
347 int compare(V v) const
350 tommath_int t(*this);
351 detail::check_tommath_result(mp_shrink(&t.data()));
357 BOOST_ASSERT(m_data.dp);
360 const ::mp_int& data() const
362 BOOST_ASSERT(m_data.dp);
365 void swap(tommath_int& o) BOOST_NOEXCEPT
367 mp_exch(&m_data, &o.data());
374 #define BOOST_MP_TOMMATH_BIT_OP_CHECK(x) \
375 if (SIGN(&x.data())) \
376 BOOST_THROW_EXCEPTION(std::runtime_error("Bitwise operations on libtommath negative valued integers are disabled as they produce unpredictable results"))
378 int eval_get_sign(const tommath_int& val);
380 inline void eval_add(tommath_int& t, const tommath_int& o)
382 detail::check_tommath_result(mp_add(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
384 inline void eval_subtract(tommath_int& t, const tommath_int& o)
386 detail::check_tommath_result(mp_sub(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
388 inline void eval_multiply(tommath_int& t, const tommath_int& o)
390 detail::check_tommath_result(mp_mul(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
392 inline void eval_divide(tommath_int& t, const tommath_int& o)
394 using default_ops::eval_is_zero;
397 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
398 detail::check_tommath_result(mp_div(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data(), &temp.data()));
400 inline void eval_modulus(tommath_int& t, const tommath_int& o)
402 using default_ops::eval_is_zero;
404 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
405 bool neg = eval_get_sign(t) < 0;
406 bool neg2 = eval_get_sign(o) < 0;
407 detail::check_tommath_result(mp_mod(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
408 if ((neg != neg2) && (eval_get_sign(t) != 0))
411 detail::check_tommath_result(mp_add(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
414 else if (neg && (t.compare(o) == 0))
420 inline void eval_left_shift(tommath_int& t, UI i)
422 detail::check_tommath_result(mp_mul_2d(&t.data(), static_cast<unsigned>(i), &t.data()));
425 inline void eval_right_shift(tommath_int& t, UI i)
427 using default_ops::eval_decrement;
428 using default_ops::eval_increment;
429 bool neg = eval_get_sign(t) < 0;
433 detail::check_tommath_result(mp_div_2d(&t.data(), static_cast<unsigned>(i), &t.data(), &d.data()));
438 inline void eval_left_shift(tommath_int& t, const tommath_int& v, UI i)
440 detail::check_tommath_result(mp_mul_2d(const_cast< ::mp_int*>(&v.data()), static_cast<unsigned>(i), &t.data()));
444 inline void eval_right_shift(tommath_int& t, const tommath_int& v, UI i)
447 detail::check_tommath_result(mp_div_2d(const_cast< ::mp_int*>(&v.data()), static_cast<unsigned long>(i), &t.data(), &d.data()));
450 inline void eval_bitwise_and(tommath_int& result, const tommath_int& v)
452 BOOST_MP_TOMMATH_BIT_OP_CHECK(result);
453 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
454 detail::check_tommath_result(mp_and(&result.data(), const_cast< ::mp_int*>(&v.data()), &result.data()));
457 inline void eval_bitwise_or(tommath_int& result, const tommath_int& v)
459 BOOST_MP_TOMMATH_BIT_OP_CHECK(result);
460 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
461 detail::check_tommath_result(mp_or(&result.data(), const_cast< ::mp_int*>(&v.data()), &result.data()));
464 inline void eval_bitwise_xor(tommath_int& result, const tommath_int& v)
466 BOOST_MP_TOMMATH_BIT_OP_CHECK(result);
467 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
468 detail::check_tommath_result(mp_xor(&result.data(), const_cast< ::mp_int*>(&v.data()), &result.data()));
471 inline void eval_add(tommath_int& t, const tommath_int& p, const tommath_int& o)
473 detail::check_tommath_result(mp_add(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
475 inline void eval_subtract(tommath_int& t, const tommath_int& p, const tommath_int& o)
477 detail::check_tommath_result(mp_sub(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
479 inline void eval_multiply(tommath_int& t, const tommath_int& p, const tommath_int& o)
481 detail::check_tommath_result(mp_mul(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
483 inline void eval_divide(tommath_int& t, const tommath_int& p, const tommath_int& o)
485 using default_ops::eval_is_zero;
488 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
489 detail::check_tommath_result(mp_div(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data(), &d.data()));
491 inline void eval_modulus(tommath_int& t, const tommath_int& p, const tommath_int& o)
493 using default_ops::eval_is_zero;
495 BOOST_THROW_EXCEPTION(std::overflow_error("Integer division by zero"));
496 bool neg = eval_get_sign(p) < 0;
497 bool neg2 = eval_get_sign(o) < 0;
498 detail::check_tommath_result(mp_mod(const_cast< ::mp_int*>(&p.data()), const_cast< ::mp_int*>(&o.data()), &t.data()));
499 if ((neg != neg2) && (eval_get_sign(t) != 0))
502 detail::check_tommath_result(mp_add(&t.data(), const_cast< ::mp_int*>(&o.data()), &t.data()));
505 else if (neg && (t.compare(o) == 0))
511 inline void eval_bitwise_and(tommath_int& result, const tommath_int& u, const tommath_int& v)
513 BOOST_MP_TOMMATH_BIT_OP_CHECK(u);
514 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
515 detail::check_tommath_result(mp_and(const_cast< ::mp_int*>(&u.data()), const_cast< ::mp_int*>(&v.data()), &result.data()));
518 inline void eval_bitwise_or(tommath_int& result, const tommath_int& u, const tommath_int& v)
520 BOOST_MP_TOMMATH_BIT_OP_CHECK(u);
521 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
522 detail::check_tommath_result(mp_or(const_cast< ::mp_int*>(&u.data()), const_cast< ::mp_int*>(&v.data()), &result.data()));
525 inline void eval_bitwise_xor(tommath_int& result, const tommath_int& u, const tommath_int& v)
527 BOOST_MP_TOMMATH_BIT_OP_CHECK(u);
528 BOOST_MP_TOMMATH_BIT_OP_CHECK(v);
529 detail::check_tommath_result(mp_xor(const_cast< ::mp_int*>(&u.data()), const_cast< ::mp_int*>(&v.data()), &result.data()));
532 inline void eval_complement(tommath_int& result, const tommath_int& u)
535 // Although this code works, it doesn't really do what the user might expect....
536 // and it's hard to see how it ever could. Disabled for now:
539 for(int i = 0; i < result.data().used; ++i)
541 result.data().dp[i] = MP_MASK & ~(result.data().dp[i]);
544 // We now need to pad out the left of the value with 1's to round up to a whole number of
545 // CHAR_BIT * sizeof(mp_digit) units. Otherwise we'll end up with a very strange number of
548 unsigned shift = result.data().used * DIGIT_BIT; // How many bits we're actually using
549 // How many bits we actually need, reduced by one to account for a mythical sign bit:
550 int padding = result.data().used * std::numeric_limits<mp_digit>::digits - shift - 1;
551 while(padding >= std::numeric_limits<mp_digit>::digits)
552 padding -= std::numeric_limits<mp_digit>::digits;
554 // Create a mask providing the extra bits we need and add to result:
556 mask = static_cast<boost::long_long_type>((1u << padding) - 1);
557 eval_left_shift(mask, shift);
561 inline bool eval_is_zero(const tommath_int& val)
563 return mp_iszero(&val.data());
565 inline int eval_get_sign(const tommath_int& val)
567 return mp_iszero(&val.data()) ? 0 : SIGN(&val.data()) ? -1 : 1;
571 inline void eval_convert_to(A* result, const tommath_int& val)
573 *result = boost::lexical_cast<A>(val.str(0, std::ios_base::fmtflags(0)));
575 inline void eval_convert_to(char* result, const tommath_int& val)
577 *result = static_cast<char>(boost::lexical_cast<int>(val.str(0, std::ios_base::fmtflags(0))));
579 inline void eval_convert_to(unsigned char* result, const tommath_int& val)
581 *result = static_cast<unsigned char>(boost::lexical_cast<unsigned>(val.str(0, std::ios_base::fmtflags(0))));
583 inline void eval_convert_to(signed char* result, const tommath_int& val)
585 *result = static_cast<signed char>(boost::lexical_cast<int>(val.str(0, std::ios_base::fmtflags(0))));
588 inline void eval_abs(tommath_int& result, const tommath_int& val)
590 detail::check_tommath_result(mp_abs(const_cast< ::mp_int*>(&val.data()), &result.data()));
592 inline void eval_gcd(tommath_int& result, const tommath_int& a, const tommath_int& b)
594 detail::check_tommath_result(mp_gcd(const_cast< ::mp_int*>(&a.data()), const_cast< ::mp_int*>(&b.data()), const_cast< ::mp_int*>(&result.data())));
596 inline void eval_lcm(tommath_int& result, const tommath_int& a, const tommath_int& b)
598 detail::check_tommath_result(mp_lcm(const_cast< ::mp_int*>(&a.data()), const_cast< ::mp_int*>(&b.data()), const_cast< ::mp_int*>(&result.data())));
600 inline void eval_powm(tommath_int& result, const tommath_int& base, const tommath_int& p, const tommath_int& m)
602 if (eval_get_sign(p) < 0)
604 BOOST_THROW_EXCEPTION(std::runtime_error("powm requires a positive exponent."));
606 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()));
609 inline void eval_qr(const tommath_int& x, const tommath_int& y,
610 tommath_int& q, tommath_int& r)
612 detail::check_tommath_result(mp_div(const_cast< ::mp_int*>(&x.data()), const_cast< ::mp_int*>(&y.data()), &q.data(), &r.data()));
615 inline unsigned eval_lsb(const tommath_int& val)
617 int c = eval_get_sign(val);
620 BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
624 BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
626 return mp_cnt_lsb(const_cast< ::mp_int*>(&val.data()));
629 inline unsigned eval_msb(const tommath_int& val)
631 int c = eval_get_sign(val);
634 BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
638 BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
640 return mp_count_bits(const_cast< ::mp_int*>(&val.data())) - 1;
643 template <class Integer>
644 inline typename enable_if<is_unsigned<Integer>, Integer>::type eval_integer_modulus(const tommath_int& x, Integer val)
646 static const mp_digit m = (static_cast<mp_digit>(1) << DIGIT_BIT) - 1;
650 detail::check_tommath_result(mp_mod_d(const_cast< ::mp_int*>(&x.data()), static_cast<mp_digit>(val), &d));
655 return default_ops::eval_integer_modulus(x, val);
658 template <class Integer>
659 inline typename enable_if<is_signed<Integer>, Integer>::type eval_integer_modulus(const tommath_int& x, Integer val)
661 return eval_integer_modulus(x, boost::multiprecision::detail::unsigned_abs(val));
664 inline std::size_t hash_value(const tommath_int& val)
666 std::size_t result = 0;
667 std::size_t len = val.data().used;
668 for (std::size_t i = 0; i < len; ++i)
669 boost::hash_combine(result, val.data().dp[i]);
670 boost::hash_combine(result, val.data().sign);
674 } // namespace backends
676 using boost::multiprecision::backends::tommath_int;
679 struct number_category<tommath_int> : public mpl::int_<number_kind_integer>
682 typedef number<tommath_int> tom_int;
683 typedef rational_adaptor<tommath_int> tommath_rational;
684 typedef number<tommath_rational> tom_rational;
686 }} // namespace boost::multiprecision
690 template <boost::multiprecision::expression_template_option ExpressionTemplates>
691 class numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >
693 typedef boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> number_type;
696 BOOST_STATIC_CONSTEXPR bool is_specialized = true;
698 // Largest and smallest numbers are bounded only by available memory, set
701 static number_type(min)()
703 return number_type();
705 static number_type(max)()
707 return number_type();
709 static number_type lowest() { return (min)(); }
710 BOOST_STATIC_CONSTEXPR int digits = INT_MAX;
711 BOOST_STATIC_CONSTEXPR int digits10 = (INT_MAX / 1000) * 301L;
712 BOOST_STATIC_CONSTEXPR int max_digits10 = digits10 + 3;
713 BOOST_STATIC_CONSTEXPR bool is_signed = true;
714 BOOST_STATIC_CONSTEXPR bool is_integer = true;
715 BOOST_STATIC_CONSTEXPR bool is_exact = true;
716 BOOST_STATIC_CONSTEXPR int radix = 2;
717 static number_type epsilon() { return number_type(); }
718 static number_type round_error() { return number_type(); }
719 BOOST_STATIC_CONSTEXPR int min_exponent = 0;
720 BOOST_STATIC_CONSTEXPR int min_exponent10 = 0;
721 BOOST_STATIC_CONSTEXPR int max_exponent = 0;
722 BOOST_STATIC_CONSTEXPR int max_exponent10 = 0;
723 BOOST_STATIC_CONSTEXPR bool has_infinity = false;
724 BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = false;
725 BOOST_STATIC_CONSTEXPR bool has_signaling_NaN = false;
726 BOOST_STATIC_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
727 BOOST_STATIC_CONSTEXPR bool has_denorm_loss = false;
728 static number_type infinity() { return number_type(); }
729 static number_type quiet_NaN() { return number_type(); }
730 static number_type signaling_NaN() { return number_type(); }
731 static number_type denorm_min() { return number_type(); }
732 BOOST_STATIC_CONSTEXPR bool is_iec559 = false;
733 BOOST_STATIC_CONSTEXPR bool is_bounded = false;
734 BOOST_STATIC_CONSTEXPR bool is_modulo = false;
735 BOOST_STATIC_CONSTEXPR bool traps = false;
736 BOOST_STATIC_CONSTEXPR bool tinyness_before = false;
737 BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero;
740 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
742 template <boost::multiprecision::expression_template_option ExpressionTemplates>
743 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::digits;
744 template <boost::multiprecision::expression_template_option ExpressionTemplates>
745 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::digits10;
746 template <boost::multiprecision::expression_template_option ExpressionTemplates>
747 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::max_digits10;
748 template <boost::multiprecision::expression_template_option ExpressionTemplates>
749 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_signed;
750 template <boost::multiprecision::expression_template_option ExpressionTemplates>
751 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_integer;
752 template <boost::multiprecision::expression_template_option ExpressionTemplates>
753 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_exact;
754 template <boost::multiprecision::expression_template_option ExpressionTemplates>
755 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::radix;
756 template <boost::multiprecision::expression_template_option ExpressionTemplates>
757 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::min_exponent;
758 template <boost::multiprecision::expression_template_option ExpressionTemplates>
759 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::min_exponent10;
760 template <boost::multiprecision::expression_template_option ExpressionTemplates>
761 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::max_exponent;
762 template <boost::multiprecision::expression_template_option ExpressionTemplates>
763 BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::max_exponent10;
764 template <boost::multiprecision::expression_template_option ExpressionTemplates>
765 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_infinity;
766 template <boost::multiprecision::expression_template_option ExpressionTemplates>
767 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_quiet_NaN;
768 template <boost::multiprecision::expression_template_option ExpressionTemplates>
769 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_signaling_NaN;
770 template <boost::multiprecision::expression_template_option ExpressionTemplates>
771 BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_denorm;
772 template <boost::multiprecision::expression_template_option ExpressionTemplates>
773 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::has_denorm_loss;
774 template <boost::multiprecision::expression_template_option ExpressionTemplates>
775 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_iec559;
776 template <boost::multiprecision::expression_template_option ExpressionTemplates>
777 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_bounded;
778 template <boost::multiprecision::expression_template_option ExpressionTemplates>
779 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::is_modulo;
780 template <boost::multiprecision::expression_template_option ExpressionTemplates>
781 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::traps;
782 template <boost::multiprecision::expression_template_option ExpressionTemplates>
783 BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::tinyness_before;
784 template <boost::multiprecision::expression_template_option ExpressionTemplates>
785 BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits<boost::multiprecision::number<boost::multiprecision::tommath_int, ExpressionTemplates> >::round_style;