Added support for small -long double- types
[SVN r22025]
This commit is contained in:
parent
1fe4edab1f
commit
66a3211887
@ -79,22 +79,32 @@ struct rounding_control<double>: detail::x86_rounding_control
|
||||
{ volatile double r_ = r; return r_; }
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<bool>
|
||||
struct x86_rounding_control_long_double;
|
||||
|
||||
template<>
|
||||
struct rounding_control<long double>: detail::x86_rounding_control
|
||||
struct x86_rounding_control_long_double<false>: x86_rounding_control
|
||||
{
|
||||
static long double force_rounding(const long double& r)
|
||||
{
|
||||
// Some compilers use "double == long double", so we may need to
|
||||
// round (from FPU registers into memory) in this case as well.
|
||||
if(sizeof(long double) > 8) {
|
||||
return r;
|
||||
} else {
|
||||
volatile long double r_ = r;
|
||||
return r_;
|
||||
}
|
||||
}
|
||||
static long double force_rounding(long double const &r)
|
||||
{ volatile long double r_ = r; return r_; }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct x86_rounding_control_long_double<true>: x86_rounding_control
|
||||
{
|
||||
static long double const &force_rounding(long double const &r)
|
||||
{ return r; }
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<>
|
||||
struct rounding_control<long double>:
|
||||
detail::x86_rounding_control_long_double< (sizeof(long double) >= 10) >
|
||||
{};
|
||||
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
Loading…
Reference in New Issue
Block a user