1 /* Boost interval/detail/c99_rounding_control.hpp file 2 * 3 * Copyright 2000 Jens Maurer 4 * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion 5 * 6 * Distributed under the Boost Software License, Version 1.0. 7 * (See accompanying file LICENSE_1_0.txt or 8 * copy at http://www.boost.org/LICENSE_1_0.txt) 9 */ 10 11 #ifndef BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP 12 #define BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP 13 14 #include <boost/numeric/interval/detail/c99sub_rounding_control.hpp> 15 16 namespace boost { 17 namespace numeric { 18 namespace interval_lib { 19 20 template<> 21 struct rounding_control<float>: 22 detail::c99_rounding_control 23 { force_roundingboost::numeric::interval_lib::rounding_control24 static float force_rounding(float const &r) 25 { volatile float r_ = r; return r_; } 26 }; 27 28 template<> 29 struct rounding_control<double>: 30 detail::c99_rounding_control 31 { force_roundingboost::numeric::interval_lib::rounding_control32 static double force_rounding(double const &r) 33 { volatile double r_ = r; return r_; } 34 }; 35 36 template<> 37 struct rounding_control<long double>: 38 detail::c99_rounding_control 39 { force_roundingboost::numeric::interval_lib::rounding_control40 static long double force_rounding(long double const &r) 41 { volatile long double r_ = r; return r_; } 42 }; 43 44 } // namespace interval_lib 45 } // namespace numeric 46 } // namespace boost 47 48 #undef BOOST_NUMERIC_INTERVAL_NO_HARDWARE 49 50 #endif // BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP 51