From: Peter Azmanov <peter.azmanov@gmail.com>
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
|
b
|
struct rounded_arith_opp: Rounding {
|
92 | 92 | # define BOOST_UP_NEG(EXPR) return -this->force_rounding(EXPR) |
93 | 93 | template<class U> T conv_down(U const &v) { BOOST_UP_NEG(-v); } |
94 | 94 | template<class U> T conv_up (U const &v) { BOOST_UP(v); } |
95 | | T add_down(const T& x, const T& y) { BOOST_UP_NEG((-x) - y); } |
| 95 | T add_down(const T& x, const T& y) { BOOST_UP_NEG(this->force_rounding(-x) - y); } |
96 | 96 | T sub_down(const T& x, const T& y) { BOOST_UP_NEG(y - x); } |
97 | | T mul_down(const T& x, const T& y) { BOOST_UP_NEG(x * (-y)); } |
98 | | T div_down(const T& x, const T& y) { BOOST_UP_NEG(x / (-y)); } |
| 97 | T mul_down(const T& x, const T& y) { BOOST_UP_NEG(x * this->force_rounding(-y)); } |
| 98 | T div_down(const T& x, const T& y) { BOOST_UP_NEG(x / this->force_rounding(-y)); } |
99 | 99 | T add_up (const T& x, const T& y) { BOOST_UP(x + y); } |
100 | 100 | T sub_up (const T& x, const T& y) { BOOST_UP(x - y); } |
101 | 101 | T mul_up (const T& x, const T& y) { BOOST_UP(x * y); } |