diff --git a/include/boost/multiprecision/cpp_dec_float.hpp b/include/boost/multiprecision/cpp_dec_float.hpp index d276e12e..5b6233fa 100644 --- a/include/boost/multiprecision/cpp_dec_float.hpp +++ b/include/boost/multiprecision/cpp_dec_float.hpp @@ -2853,40 +2853,89 @@ namespace std class numeric_limits, ExpressionTemplates> > { public: - static const bool is_specialized = true; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const bool is_bounded = true; - static const bool is_modulo = false; - static const bool is_iec559 = false; - static const int digits = boost::multiprecision::cpp_dec_float::cpp_dec_float_digits10; - static const int digits10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_digits10; - static const int max_digits10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_total_digits10; - static const boost::int64_t min_exponent = boost::multiprecision::cpp_dec_float::cpp_dec_float_min_exp; // Type differs from int. - static const boost::int64_t min_exponent10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_min_exp10; // Type differs from int. - static const boost::int64_t max_exponent = boost::multiprecision::cpp_dec_float::cpp_dec_float_max_exp; // Type differs from int. - static const boost::int64_t max_exponent10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_max_exp10; // Type differs from int. - static const int radix = boost::multiprecision::cpp_dec_float::cpp_dec_float_radix; - static const std::float_round_style round_style = std::round_to_nearest; - static const bool has_infinity = true; - static const bool has_quiet_NaN = true; - static const bool has_signaling_NaN = false; - static const std::float_denorm_style has_denorm = std::denorm_absent; - static const bool has_denorm_loss = false; - static const bool traps = false; - static const bool tinyness_before = false; + BOOST_STATIC_CONSTEXPR bool is_specialized = true; + BOOST_STATIC_CONSTEXPR bool is_signed = true; + BOOST_STATIC_CONSTEXPR bool is_integer = false; + BOOST_STATIC_CONSTEXPR bool is_exact = false; + BOOST_STATIC_CONSTEXPR bool is_bounded = true; + BOOST_STATIC_CONSTEXPR bool is_modulo = false; + BOOST_STATIC_CONSTEXPR bool is_iec559 = false; + BOOST_STATIC_CONSTEXPR int digits = boost::multiprecision::cpp_dec_float::cpp_dec_float_digits10; + BOOST_STATIC_CONSTEXPR int digits10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_digits10; + BOOST_STATIC_CONSTEXPR int max_digits10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_total_digits10; + BOOST_STATIC_CONSTEXPR boost::int64_t min_exponent = boost::multiprecision::cpp_dec_float::cpp_dec_float_min_exp; // Type differs from int. + BOOST_STATIC_CONSTEXPR boost::int64_t min_exponent10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_min_exp10; // Type differs from int. + BOOST_STATIC_CONSTEXPR boost::int64_t max_exponent = boost::multiprecision::cpp_dec_float::cpp_dec_float_max_exp; // Type differs from int. + BOOST_STATIC_CONSTEXPR boost::int64_t max_exponent10 = boost::multiprecision::cpp_dec_float::cpp_dec_float_max_exp10; // Type differs from int. + BOOST_STATIC_CONSTEXPR int radix = boost::multiprecision::cpp_dec_float::cpp_dec_float_radix; + BOOST_STATIC_CONSTEXPR std::float_round_style round_style = std::round_to_nearest; + BOOST_STATIC_CONSTEXPR bool has_infinity = true; + BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = true; + BOOST_STATIC_CONSTEXPR bool has_signaling_NaN = false; + BOOST_STATIC_CONSTEXPR std::float_denorm_style has_denorm = std::denorm_absent; + BOOST_STATIC_CONSTEXPR bool has_denorm_loss = false; + BOOST_STATIC_CONSTEXPR bool traps = false; + BOOST_STATIC_CONSTEXPR bool tinyness_before = false; - static const boost::multiprecision::mp_number, ExpressionTemplates> (min) (void) { return (boost::multiprecision::cpp_dec_float::min)(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> (max) (void) { return (boost::multiprecision::cpp_dec_float::max)(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> lowest (void) { return boost::multiprecision::cpp_dec_float::zero(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> epsilon (void) { return boost::multiprecision::cpp_dec_float::eps(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> round_error (void) { return 0.5L; } - static const boost::multiprecision::mp_number, ExpressionTemplates> infinity (void) { return boost::multiprecision::cpp_dec_float::inf(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> quiet_NaN (void) { return boost::multiprecision::cpp_dec_float::nan(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> signaling_NaN(void) { return boost::multiprecision::cpp_dec_float::zero(); } - static const boost::multiprecision::mp_number, ExpressionTemplates> denorm_min (void) { return boost::multiprecision::cpp_dec_float::zero(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> (min) (void) { return (boost::multiprecision::cpp_dec_float::min)(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> (max) (void) { return (boost::multiprecision::cpp_dec_float::max)(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> lowest (void) { return boost::multiprecision::cpp_dec_float::zero(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> epsilon (void) { return boost::multiprecision::cpp_dec_float::eps(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> round_error (void) { return 0.5L; } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> infinity (void) { return boost::multiprecision::cpp_dec_float::inf(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> quiet_NaN (void) { return boost::multiprecision::cpp_dec_float::nan(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> signaling_NaN(void) { return boost::multiprecision::cpp_dec_float::zero(); } + BOOST_STATIC_CONSTEXPR boost::multiprecision::mp_number, ExpressionTemplates> denorm_min (void) { return boost::multiprecision::cpp_dec_float::zero(); } }; + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +template +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST boost::int64_t numeric_limits, ExpressionTemplates> >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; + +#endif } namespace boost{ namespace math{ diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp index c6e4864d..ed6a318d 100644 --- a/include/boost/multiprecision/cpp_int.hpp +++ b/include/boost/multiprecision/cpp_int.hpp @@ -2362,49 +2362,49 @@ public: #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION template -const int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -const int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -const int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -const bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -const bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -const bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -const int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -const int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -const int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -const int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -const int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -const bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -const bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -const bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -const float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -const bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -const bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -const bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -const bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -const bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -const bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -const float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif @@ -2491,49 +2491,49 @@ const typename numeric_limits -const int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -const int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -const int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -const bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -const bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -const bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -const int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -const int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -const int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -const int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -const int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -const bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -const bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -const bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -const float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -const bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -const bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -const bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -const bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -const bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -const bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -const float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif @@ -2619,49 +2619,49 @@ const typename numeric_limits -const int numeric_limits, ExpressionTemplates> >::digits; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; template -const int numeric_limits, ExpressionTemplates> >::digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; template -const int numeric_limits, ExpressionTemplates> >::max_digits10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; template -const bool numeric_limits, ExpressionTemplates> >::is_signed; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; template -const bool numeric_limits, ExpressionTemplates> >::is_integer; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; template -const bool numeric_limits, ExpressionTemplates> >::is_exact; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; template -const int numeric_limits, ExpressionTemplates> >::radix; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; template -const int numeric_limits, ExpressionTemplates> >::min_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; template -const int numeric_limits, ExpressionTemplates> >::min_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; template -const int numeric_limits, ExpressionTemplates> >::max_exponent; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; template -const int numeric_limits, ExpressionTemplates> >::max_exponent10; +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; template -const bool numeric_limits, ExpressionTemplates> >::has_infinity; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; template -const bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; template -const bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; template -const float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; template -const bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; template -const bool numeric_limits, ExpressionTemplates> >::is_iec559; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; template -const bool numeric_limits, ExpressionTemplates> >::is_bounded; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; template -const bool numeric_limits, ExpressionTemplates> >::is_modulo; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; template -const bool numeric_limits, ExpressionTemplates> >::traps; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; template -const bool numeric_limits, ExpressionTemplates> >::tinyness_before; +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; template -const float_round_style numeric_limits, ExpressionTemplates> >::round_style; +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; #endif diff --git a/include/boost/multiprecision/detail/no_et_ops.hpp b/include/boost/multiprecision/detail/no_et_ops.hpp index 3710c644..c57d7b00 100644 --- a/include/boost/multiprecision/detail/no_et_ops.hpp +++ b/include/boost/multiprecision/detail/no_et_ops.hpp @@ -298,6 +298,336 @@ inline typename enable_if, mp_number >::type return result; } +#ifndef BOOST_NO_RVALUE_REFERENCES +// +// If we have rvalue references go all over again with rvalue ref overloads and move semantics: +// +template +inline mp_number&& operator - (mp_number&& v) +{ + v.backend().negate(); + return static_cast&&>(v); +} +template +inline mp_number&& operator ~ (mp_number&& v) +{ + eval_complement(v.backend(), v.backend()); + return static_cast&&>(v); +} +// +// Addition: +// +template +inline mp_number&& operator + (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_add; + eval_add(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline mp_number&& operator + (const mp_number& a, mp_number&& b) +{ + using default_ops::eval_add; + eval_add(b.backend(), a.backend()); + return static_cast&&>(b); +} +template +inline mp_number&& operator + (mp_number&& a, mp_number&& b) +{ + using default_ops::eval_add; + eval_add(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator + (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_add; + eval_add(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator + (const V& a, mp_number&& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_add; + eval_add(b.backend(), static_cast(a)); + return static_cast&&>(b); +} +// +// Subtraction: +// +template +inline mp_number&& operator - (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_subtract; + eval_subtract(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline mp_number&& operator - (const mp_number& a, mp_number&& b) +{ + using default_ops::eval_subtract; + eval_subtract(b.backend(), a.backend()); + b.backend().negate(); + return static_cast&&>(b); +} +template +inline mp_number&& operator - (mp_number&& a, mp_number&& b) +{ + using default_ops::eval_subtract; + eval_subtract(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator - (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_subtract; + eval_subtract(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator - (const V& a, mp_number&& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_subtract; + eval_subtract(b.backend(), static_cast(a)); + b.backend().negate(); + return static_cast&&>(b); +} +// +// Multiply: +// +template +inline mp_number&& operator * (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_multiply; + eval_multiply(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline mp_number&& operator * (const mp_number& a, mp_number&& b) +{ + using default_ops::eval_multiply; + eval_multiply(b.backend(), a.backend()); + return static_cast&&>(b); +} +template +inline mp_number&& operator * (mp_number&& a, mp_number&& b) +{ + using default_ops::eval_multiply; + eval_multiply(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator * (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_multiply; + eval_multiply(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator * (const V& a, mp_number&& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_multiply; + eval_multiply(b.backend(), static_cast(a)); + return static_cast&&>(b); +} +// +// divide: +// +template +inline mp_number&& operator / (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_divide; + eval_divide(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator / (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_divide; + eval_divide(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +// +// modulus: +// +template +inline mp_number&& operator % (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_modulus; + eval_modulus(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator % (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_modulus; + eval_modulus(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +// +// Bitwise or: +// +template +inline mp_number&& operator | (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_bitwise_or; + eval_bitwise_or(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline mp_number&& operator | (const mp_number& a, mp_number&& b) +{ + using default_ops::eval_bitwise_or; + eval_bitwise_or(b.backend(), a.backend()); + return static_cast&&>(b); +} +template +inline mp_number&& operator | (mp_number&& a, mp_number&& b) +{ + using default_ops::eval_bitwise_or; + eval_bitwise_or(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator | (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_bitwise_or; + eval_bitwise_or(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator | (const V& a, mp_number&& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_bitwise_or; + eval_bitwise_or(b.backend(), static_cast(a)); + return static_cast&&>(b); +} +// +// Bitwise xor: +// +template +inline mp_number&& operator ^ (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_bitwise_xor; + eval_bitwise_xor(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline mp_number&& operator ^ (const mp_number& a, mp_number&& b) +{ + using default_ops::eval_bitwise_xor; + eval_bitwise_xor(b.backend(), a.backend()); + return static_cast&&>(b); +} +template +inline mp_number&& operator ^ (mp_number&& a, mp_number&& b) +{ + using default_ops::eval_bitwise_xor; + eval_bitwise_xor(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator ^ (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_bitwise_xor; + eval_bitwise_xor(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator ^ (const V& a, mp_number&& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_bitwise_xor; + eval_bitwise_xor(b.backend(), static_cast(a)); + return static_cast&&>(b); +} +// +// Bitwise and: +// +template +inline mp_number&& operator & (mp_number&& a, const mp_number& b) +{ + using default_ops::eval_bitwise_and; + eval_bitwise_and(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline mp_number&& operator & (const mp_number& a, mp_number&& b) +{ + using default_ops::eval_bitwise_and; + eval_bitwise_and(b.backend(), a.backend()); + return static_cast&&>(b); +} +template +inline mp_number&& operator & (mp_number&& a, mp_number&& b) +{ + using default_ops::eval_bitwise_and; + eval_bitwise_and(a.backend(), b.backend()); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator & (mp_number&& a, const V& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_bitwise_and; + eval_bitwise_and(a.backend(), static_cast(b)); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator & (const V& a, mp_number&& b) +{ + typedef typename detail::canonical::type canonical_type; + using default_ops::eval_bitwise_and; + eval_bitwise_and(b.backend(), static_cast(a)); + return static_cast&&>(b); +} +// +// shifts: +// +template +inline typename enable_if, mp_number&& >::type + operator << (mp_number&& a, const I& b) +{ + using default_ops::eval_left_shift; + eval_left_shift(a.backend(), b); + return static_cast&&>(a); +} +template +inline typename enable_if, mp_number&& >::type + operator >> (mp_number&& a, const I& b) +{ + using default_ops::eval_right_shift; + eval_right_shift(a.backend(), b); + return static_cast&&>(a); +} + +#endif + }} // namespaces #endif // BOOST_MP_NO_ET_OPS_HPP diff --git a/include/boost/multiprecision/gmp.hpp b/include/boost/multiprecision/gmp.hpp index fef98b76..396ba558 100644 --- a/include/boost/multiprecision/gmp.hpp +++ b/include/boost/multiprecision/gmp.hpp @@ -1993,6 +1993,55 @@ public: BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero; }; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; + +#endif + template class numeric_limits > { @@ -2042,6 +2091,55 @@ public: BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero; }; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; + +#endif + template class numeric_limits > { @@ -2092,6 +2190,55 @@ public: BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero; }; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; + +#endif + #ifdef BOOST_MSVC #pragma warning(pop) #endif diff --git a/include/boost/multiprecision/mpfr.hpp b/include/boost/multiprecision/mpfr.hpp index 1ea8f782..98f82825 100644 --- a/include/boost/multiprecision/mpfr.hpp +++ b/include/boost/multiprecision/mpfr.hpp @@ -1174,6 +1174,56 @@ private: template const typename numeric_limits, ExpressionTemplates> >::data_initializer numeric_limits, ExpressionTemplates> >::initializer; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +template +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST long numeric_limits, ExpressionTemplates> >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; + +#endif + + template class numeric_limits, ExpressionTemplates> > { @@ -1213,5 +1263,53 @@ public: BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero; }; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::radix; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits, ExpressionTemplates> >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits, ExpressionTemplates> >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits, ExpressionTemplates> >::round_style; + +#endif } // namespace std #endif diff --git a/include/boost/multiprecision/rational_adapter.hpp b/include/boost/multiprecision/rational_adapter.hpp index 0aa4ec70..c6a53aa7 100644 --- a/include/boost/multiprecision/rational_adapter.hpp +++ b/include/boost/multiprecision/rational_adapter.hpp @@ -197,8 +197,8 @@ struct component_type > namespace std{ -template -class numeric_limits > > : public std::numeric_limits > +template +class numeric_limits, ExpressionTemplates> > : public std::numeric_limits > { typedef std::numeric_limits > base_type; typedef boost::multiprecision::mp_number > number_type; @@ -216,6 +216,16 @@ public: BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_NOEXCEPT { return base_type::denorm_min(); } }; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits, ExpressionTemplates> >::is_exact; + +#endif + + } #endif diff --git a/include/boost/multiprecision/tommath.hpp b/include/boost/multiprecision/tommath.hpp index 6eaa6c4f..e67cf8fe 100644 --- a/include/boost/multiprecision/tommath.hpp +++ b/include/boost/multiprecision/tommath.hpp @@ -540,6 +540,54 @@ public: BOOST_STATIC_CONSTEXPR float_round_style round_style = round_toward_zero; }; +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::digits10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_digits10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_signed; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_integer; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_exact; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::radix; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::min_exponent10; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent; +template +BOOST_CONSTEXPR_OR_CONST int numeric_limits >::max_exponent10; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_infinity; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_quiet_NaN; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_signaling_NaN; +template +BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits >::has_denorm; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::has_denorm_loss; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_iec559; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_bounded; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::is_modulo; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::traps; +template +BOOST_CONSTEXPR_OR_CONST bool numeric_limits >::tinyness_before; +template +BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits >::round_style; + +#endif } #endif diff --git a/performance/float_backend.hpp b/performance/float_backend.hpp index 59b88c2f..8b2f2c9b 100644 --- a/performance/float_backend.hpp +++ b/performance/float_backend.hpp @@ -404,15 +404,15 @@ class numeric_limits base_type; typedef boost::multiprecision::mp_number, ExpressionTemplates> number_type; public: - BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_MP_NOEXCEPT { return (base_type::min)(); } - BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_MP_NOEXCEPT { return (base_type::max)(); } - BOOST_STATIC_CONSTEXPR number_type lowest() BOOST_MP_NOEXCEPT { return -(max)(); } - BOOST_STATIC_CONSTEXPR number_type epsilon() BOOST_MP_NOEXCEPT { return base_type::epsilon(); } - BOOST_STATIC_CONSTEXPR number_type round_error() BOOST_MP_NOEXCEPT { return epsilon() / 2; } - BOOST_STATIC_CONSTEXPR number_type infinity() BOOST_MP_NOEXCEPT { return base_type::infinity(); } - BOOST_STATIC_CONSTEXPR number_type quiet_NaN() BOOST_MP_NOEXCEPT { return base_type::quiet_NaN(); } - BOOST_STATIC_CONSTEXPR number_type signaling_NaN() BOOST_MP_NOEXCEPT { return base_type::signaling_NaN(); } - BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_MP_NOEXCEPT { return base_type::denorm_min(); } + BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_NOEXCEPT { return (base_type::min)(); } + BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_NOEXCEPT { return (base_type::max)(); } + BOOST_STATIC_CONSTEXPR number_type lowest() BOOST_NOEXCEPT { return -(max)(); } + BOOST_STATIC_CONSTEXPR number_type epsilon() BOOST_NOEXCEPT { return base_type::epsilon(); } + BOOST_STATIC_CONSTEXPR number_type round_error() BOOST_NOEXCEPT { return epsilon() / 2; } + BOOST_STATIC_CONSTEXPR number_type infinity() BOOST_NOEXCEPT { return base_type::infinity(); } + BOOST_STATIC_CONSTEXPR number_type quiet_NaN() BOOST_NOEXCEPT { return base_type::quiet_NaN(); } + BOOST_STATIC_CONSTEXPR number_type signaling_NaN() BOOST_NOEXCEPT { return base_type::signaling_NaN(); } + BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_NOEXCEPT { return base_type::denorm_min(); } }; template<> @@ -421,15 +421,15 @@ class numeric_limits : public std::numeric_ typedef std::numeric_limits base_type; typedef boost::math::concepts::real_concept number_type; public: - BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_MP_NOEXCEPT { return (base_type::min)(); } - BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_MP_NOEXCEPT { return (base_type::max)(); } - BOOST_STATIC_CONSTEXPR number_type lowest() BOOST_MP_NOEXCEPT { return -(max)(); } - BOOST_STATIC_CONSTEXPR number_type epsilon() BOOST_MP_NOEXCEPT { return base_type::epsilon(); } - BOOST_STATIC_CONSTEXPR number_type round_error() BOOST_MP_NOEXCEPT { return epsilon() / 2; } - BOOST_STATIC_CONSTEXPR number_type infinity() BOOST_MP_NOEXCEPT { return base_type::infinity(); } - BOOST_STATIC_CONSTEXPR number_type quiet_NaN() BOOST_MP_NOEXCEPT { return base_type::quiet_NaN(); } - BOOST_STATIC_CONSTEXPR number_type signaling_NaN() BOOST_MP_NOEXCEPT { return base_type::signaling_NaN(); } - BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_MP_NOEXCEPT { return base_type::denorm_min(); } + BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_NOEXCEPT { return (base_type::min)(); } + BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_NOEXCEPT { return (base_type::max)(); } + BOOST_STATIC_CONSTEXPR number_type lowest() BOOST_NOEXCEPT { return -(max)(); } + BOOST_STATIC_CONSTEXPR number_type epsilon() BOOST_NOEXCEPT { return base_type::epsilon(); } + BOOST_STATIC_CONSTEXPR number_type round_error() BOOST_NOEXCEPT { return epsilon() / 2; } + BOOST_STATIC_CONSTEXPR number_type infinity() BOOST_NOEXCEPT { return base_type::infinity(); } + BOOST_STATIC_CONSTEXPR number_type quiet_NaN() BOOST_NOEXCEPT { return base_type::quiet_NaN(); } + BOOST_STATIC_CONSTEXPR number_type signaling_NaN() BOOST_NOEXCEPT { return base_type::signaling_NaN(); } + BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_NOEXCEPT { return base_type::denorm_min(); } }; }