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