Rev | Line | |
---|
[1022] | 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 | namespace detail { |
---|
| 20 | |
---|
| 21 | struct c99_rounding_control: c99_rounding |
---|
| 22 | { |
---|
| 23 | template<class T> |
---|
| 24 | static T force_rounding(const T& r) { volatile T r_ = r; return r_; } |
---|
| 25 | }; |
---|
| 26 | |
---|
| 27 | } // namespace detail |
---|
| 28 | |
---|
| 29 | template<> |
---|
| 30 | struct rounding_control<float>: |
---|
| 31 | detail::c99_rounding_control { }; |
---|
| 32 | |
---|
| 33 | template<> |
---|
| 34 | struct rounding_control<double>: |
---|
| 35 | detail::c99_rounding_control { }; |
---|
| 36 | |
---|
| 37 | template<> |
---|
| 38 | struct rounding_control<long double>: |
---|
| 39 | detail::c99_rounding_control { }; |
---|
| 40 | |
---|
| 41 | } // namespace interval_lib |
---|
| 42 | } // namespace numeric |
---|
| 43 | } // namespace boost |
---|
| 44 | |
---|
| 45 | #undef BOOST_NUMERIC_INTERVAL_NO_HARDWARE |
---|
| 46 | |
---|
| 47 | #endif // BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP |
---|
Note: See
TracBrowser
for help on using the repository browser.