From: Peter Azmanov Date: Wed, 24 Feb 2016 13:41:07 +0300 Subject: [PATCH] boost-interval: workaround: msvc 14 optimizations prevent rounding to work as expected --- boost/include/boost/numeric/interval/rounded_arith.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boost/include/boost/numeric/interval/rounded_arith.hpp b/boost/include/boost/numeric/interval/rounded_arith.hpp index 2520274..20a6da6 100644 --- a/boost/include/boost/numeric/interval/rounded_arith.hpp +++ b/boost/include/boost/numeric/interval/rounded_arith.hpp @@ -92,10 +92,10 @@ struct rounded_arith_opp: Rounding { # define BOOST_UP_NEG(EXPR) return -this->force_rounding(EXPR) template T conv_down(U const &v) { BOOST_UP_NEG(-v); } template T conv_up (U const &v) { BOOST_UP(v); } - T add_down(const T& x, const T& y) { BOOST_UP_NEG((-x) - y); } + T add_down(const T& x, const T& y) { BOOST_UP_NEG(this->force_rounding(-x) - y); } T sub_down(const T& x, const T& y) { BOOST_UP_NEG(y - x); } - T mul_down(const T& x, const T& y) { BOOST_UP_NEG(x * (-y)); } - T div_down(const T& x, const T& y) { BOOST_UP_NEG(x / (-y)); } + T mul_down(const T& x, const T& y) { BOOST_UP_NEG(x * this->force_rounding(-y)); } + T div_down(const T& x, const T& y) { BOOST_UP_NEG(x / this->force_rounding(-y)); } T add_up (const T& x, const T& y) { BOOST_UP(x + y); } T sub_up (const T& x, const T& y) { BOOST_UP(x - y); } T mul_up (const T& x, const T& y) { BOOST_UP(x * y); } -- 2.7.0.windows.1