Boost logo

Boost Users :

Subject: Re: [Boost-users] [numeric conversation] behavior on std::numeric_limits<double>::max() + eps with numeric_cast
From: John Maddock (boost.regex_at_[hidden])
Date: 2014-06-16 11:41:49


>>> Is there a way to override the default implementation for e.g. double?
>>> The attached example fails to compile due to
>>> redefinition of 'struct boost::numeric::numeric_cast_traits<double,
>>> double>'
>>
>> If you define BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS then
>> you can define the conversions for fundamental types. Even so,
>> converting from double to double won't affect the value. There is a
>> layer that checks for this an implements a trivial conversion that does
>> nothing but return a const T&.
>
> so, I can't use it like boost.math.round
> (<boost/math/special_functions/round.hpp>) with polycies or doubles,
> isn't it?

Why would you want to? It's a type conversion utility not a rounding
one, if you want to do rounding why not use the Boost.Math functions
directly?

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net