summaryrefslogtreecommitdiff
path: root/boost/numeric/interval
diff options
context:
space:
mode:
Diffstat (limited to 'boost/numeric/interval')
-rw-r--r--boost/numeric/interval/compare/set.hpp12
-rw-r--r--boost/numeric/interval/detail/bugs.hpp31
-rw-r--r--boost/numeric/interval/detail/msvc_rounding_control.hpp15
-rw-r--r--boost/numeric/interval/limits.hpp2
-rw-r--r--boost/numeric/interval/rounded_arith.hpp8
5 files changed, 24 insertions, 44 deletions
diff --git a/boost/numeric/interval/compare/set.hpp b/boost/numeric/interval/compare/set.hpp
index aa4f1716b2..44f4d6ee6c 100644
--- a/boost/numeric/interval/compare/set.hpp
+++ b/boost/numeric/interval/compare/set.hpp
@@ -27,7 +27,7 @@ bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
}
template<class T, class Policies> inline
-bool operator<(const interval<T, Policies>& x, const T& y)
+bool operator<(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}
@@ -39,7 +39,7 @@ bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y
}
template<class T, class Policies> inline
-bool operator<=(const interval<T, Policies>& x, const T& y)
+bool operator<=(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}
@@ -51,7 +51,7 @@ bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
}
template<class T, class Policies> inline
-bool operator>(const interval<T, Policies>& x, const T& y)
+bool operator>(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}
@@ -63,7 +63,7 @@ bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y
}
template<class T, class Policies> inline
-bool operator>=(const interval<T, Policies>& x, const T& y)
+bool operator>=(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}
@@ -75,7 +75,7 @@ bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y
}
template<class T, class Policies> inline
-bool operator==(const interval<T, Policies>& x, const T& y)
+bool operator==(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}
@@ -87,7 +87,7 @@ bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y
}
template<class T, class Policies> inline
-bool operator!=(const interval<T, Policies>& x, const T& y)
+bool operator!=(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}
diff --git a/boost/numeric/interval/detail/bugs.hpp b/boost/numeric/interval/detail/bugs.hpp
index cc37988d71..b9b421a230 100644
--- a/boost/numeric/interval/detail/bugs.hpp
+++ b/boost/numeric/interval/detail/bugs.hpp
@@ -45,35 +45,4 @@
# define BOOST_NUMERIC_INTERVAL_using_ahyp(a)
#endif
-#if defined(__GNUC__) && (__GNUC__ <= 2)
-// cf PR c++/1981 for a description of the bug
-#include <algorithm>
-#include <boost/config/no_tr1/cmath.hpp>
-namespace boost {
-namespace numeric {
- using std::min;
- using std::max;
- using std::sqrt;
- using std::exp;
- using std::log;
- using std::cos;
- using std::tan;
- using std::asin;
- using std::acos;
- using std::atan;
- using std::ceil;
- using std::floor;
- using std::sinh;
- using std::cosh;
- using std::tanh;
-# undef BOOST_NUMERIC_INTERVAL_using_max
-# undef BOOST_NUMERIC_INTERVAL_using_math
-# define BOOST_NUMERIC_INTERVAL_using_max(a)
-# define BOOST_NUMERIC_INTERVAL_using_math(a)
-# undef BOOST_NUMERIC_INTERVAL_using_ahyp
-# define BOOST_NUMERIC_INTERVAL_using_ahyp(a)
-} // namespace numeric
-} // namespace boost
-#endif
-
#endif // BOOST_NUMERIC_INTERVAL_DETAIL_BUGS
diff --git a/boost/numeric/interval/detail/msvc_rounding_control.hpp b/boost/numeric/interval/detail/msvc_rounding_control.hpp
index d36e802429..ccf1e8b476 100644
--- a/boost/numeric/interval/detail/msvc_rounding_control.hpp
+++ b/boost/numeric/interval/detail/msvc_rounding_control.hpp
@@ -88,7 +88,20 @@ struct x86_rounding
static void get_rounding_mode(rounding_mode& mode)
{ mode = msvc2hard(_control87(0, 0)); }
static void set_rounding_mode(const rounding_mode mode)
- { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC); }
+ {
+ _control87(hard2msvc(mode),
+ _MCW_EM | _MCW_RC
+#if !defined(_M_AMD64) && !defined(_M_ARM)
+ // x64 ignores _MCW_PC and _MCW_IC, and the Debug CRT library actually
+ // asserts when these are passed to _control87.
+ // MSDN says on '_control87' that changing precision (_MCW_PC) or
+ // infinity (_MCW_IC) handling is not supported on the ARM and x64
+ // architectures and that _control87 raises an assertion
+ // and the invalid parameter handler is invoked.
+ | _MCW_PC | _MCW_IC
+#endif
+ );
+ }
static double to_int(const double& x) { return rint(x); }
};
diff --git a/boost/numeric/interval/limits.hpp b/boost/numeric/interval/limits.hpp
index d691ccee22..973681dbc5 100644
--- a/boost/numeric/interval/limits.hpp
+++ b/boost/numeric/interval/limits.hpp
@@ -11,7 +11,6 @@
#ifndef BOOST_NUMERIC_INTERVAL_LIMITS_HPP
#define BOOST_NUMERIC_INTERVAL_LIMITS_HPP
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/config.hpp>
#include <boost/limits.hpp>
@@ -46,6 +45,5 @@ private:
} // namespace std
-#endif
#endif // BOOST_NUMERIC_INTERVAL_LIMITS_HPP
diff --git a/boost/numeric/interval/rounded_arith.hpp b/boost/numeric/interval/rounded_arith.hpp
index 8b2d9a7187..2520274a6a 100644
--- a/boost/numeric/interval/rounded_arith.hpp
+++ b/boost/numeric/interval/rounded_arith.hpp
@@ -68,8 +68,8 @@ struct rounded_arith_std: Rounding {
{ BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_DN(sqrt(x)); }
T sqrt_up (const T& x)
{ BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_UP(sqrt(x)); }
- T int_down(const T& x) { this->downward(); return to_int(x); }
- T int_up (const T& x) { this->upward(); return to_int(x); }
+ T int_down(const T& x) { this->downward(); return this->to_int(x); }
+ T int_up (const T& x) { this->upward(); return this->to_int(x); }
# undef BOOST_DN
# undef BOOST_NR
# undef BOOST_UP
@@ -105,8 +105,8 @@ struct rounded_arith_opp: Rounding {
{ BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_DN(sqrt(x)); }
T sqrt_up (const T& x)
{ BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_UP(sqrt(x)); }
- T int_down(const T& x) { return -to_int(-x); }
- T int_up (const T& x) { return to_int(x); }
+ T int_down(const T& x) { return -this->to_int(-x); }
+ T int_up (const T& x) { return this->to_int(x); }
# undef BOOST_DN
# undef BOOST_NR
# undef BOOST_UP