Boost logo

Boost Users :

Subject: Re: [Boost-users] [numeric conversation] behavior on std::numeric_limits<double>::max() + eps with numeric_cast
From: Brandon Kohn (blkohn_at_[hidden])
Date: 2014-06-16 08:26:33


On 6/15/2014 14:15 PM, Olaf Peter wrote:
>
> 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&.

On 6/15/2014 14:56 PM, Olaf Peter wrote:
> Probably I did though to complicated before; but even using
> make_converter_from doesn't compile :( Is the way correct and only my
> typedef wrong?
>
> BTW; why isn't there a RoundMath<> here, RoundEven<> policy does exist.

What type of round does RoundMath do?


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