mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-02-19 02:22:17 +00:00
Merge rational fixes
This commit is contained in:
@@ -1042,7 +1042,7 @@ inline std::size_t hash_value(const mpfi_float_backend<Digits10>& val)
|
||||
std::size_t len = val.left_data()[0]._mpfr_prec / mp_bits_per_limb;
|
||||
if(val.left_data()[0]._mpfr_prec % mp_bits_per_limb)
|
||||
++len;
|
||||
for(int i = 0; i < len; ++i)
|
||||
for(std::size_t i = 0; i < len; ++i)
|
||||
boost::hash_combine(result, val.left_data()[0]._mpfr_d[i]);
|
||||
boost::hash_combine(result, val.left_data()[0]._mpfr_exp);
|
||||
boost::hash_combine(result, val.left_data()[0]._mpfr_sign);
|
||||
@@ -1050,7 +1050,7 @@ inline std::size_t hash_value(const mpfi_float_backend<Digits10>& val)
|
||||
len = val.right_data()[0]._mpfr_prec / mp_bits_per_limb;
|
||||
if(val.right_data()[0]._mpfr_prec % mp_bits_per_limb)
|
||||
++len;
|
||||
for(int i = 0; i < len; ++i)
|
||||
for(std::size_t i = 0; i < len; ++i)
|
||||
boost::hash_combine(result, val.right_data()[0]._mpfr_d[i]);
|
||||
boost::hash_combine(result, val.right_data()[0]._mpfr_exp);
|
||||
boost::hash_combine(result, val.right_data()[0]._mpfr_sign);
|
||||
@@ -1420,7 +1420,7 @@ struct constant_pi<boost::multiprecision::number<boost::multiprecision::mpfi_flo
|
||||
{
|
||||
typedef boost::multiprecision::number<boost::multiprecision::mpfi_float_backend<Digits10>, ExpressionTemplates> result_type;
|
||||
template<int N>
|
||||
static inline result_type const& get(const mpl::int_<N>&)
|
||||
static inline const result_type& get(const mpl::int_<N>&)
|
||||
{
|
||||
mpfi_initializer<result_type>::force_instantiate();
|
||||
static result_type result;
|
||||
@@ -1444,7 +1444,7 @@ struct constant_ln_two<boost::multiprecision::number<boost::multiprecision::mpfi
|
||||
{
|
||||
typedef boost::multiprecision::number<boost::multiprecision::mpfi_float_backend<Digits10>, ExpressionTemplates> result_type;
|
||||
template<int N>
|
||||
static inline result_type get(const mpl::int_<N>&)
|
||||
static inline const result_type& get(const mpl::int_<N>&)
|
||||
{
|
||||
mpfi_initializer<result_type>::force_instantiate();
|
||||
static result_type result;
|
||||
|
||||
@@ -1517,7 +1517,7 @@ inline std::size_t hash_value(const mpfr_float_backend<Digits10, AllocateType>&
|
||||
std::size_t len = val.data()[0]._mpfr_prec / mp_bits_per_limb;
|
||||
if(val.data()[0]._mpfr_prec % mp_bits_per_limb)
|
||||
++len;
|
||||
for(int i = 0; i < len; ++i)
|
||||
for(std::size_t i = 0; i < len; ++i)
|
||||
boost::hash_combine(result, val.data()[0]._mpfr_d[i]);
|
||||
boost::hash_combine(result, val.data()[0]._mpfr_exp);
|
||||
boost::hash_combine(result, val.data()[0]._mpfr_sign);
|
||||
|
||||
@@ -1856,78 +1856,6 @@ inline std::istream& operator >> (std::istream& is, rational<multiprecision::num
|
||||
return is;
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator == (const rational<multiprecision::number<T, ExpressionTemplates> >& a, const Arithmetic& b)
|
||||
{
|
||||
return a == multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator == (const Arithmetic& b, const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
return a == multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator != (const rational<multiprecision::number<T, ExpressionTemplates> >& a, const Arithmetic& b)
|
||||
{
|
||||
return a != multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator != (const Arithmetic& b, const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
return a != multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator < (const rational<multiprecision::number<T, ExpressionTemplates> >& a, const Arithmetic& b)
|
||||
{
|
||||
return a < multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator < (const Arithmetic& b, const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
return a > multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator <= (const rational<multiprecision::number<T, ExpressionTemplates> >& a, const Arithmetic& b)
|
||||
{
|
||||
return a <= multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator <= (const Arithmetic& b, const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
return a >= multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator > (const rational<multiprecision::number<T, ExpressionTemplates> >& a, const Arithmetic& b)
|
||||
{
|
||||
return a > multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator > (const Arithmetic& b, const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
return a < multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator >= (const rational<multiprecision::number<T, ExpressionTemplates> >& a, const Arithmetic& b)
|
||||
{
|
||||
return a >= multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates, class Arithmetic>
|
||||
typename boost::enable_if<boost::is_arithmetic<Arithmetic>, bool>::type operator >= (const Arithmetic& b, const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
return a <= multiprecision::number<T, ExpressionTemplates>(b);
|
||||
}
|
||||
|
||||
template <class T, multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline multiprecision::number<T, ExpressionTemplates> numerator(const rational<multiprecision::number<T, ExpressionTemplates> >& a)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user