Boost logo

Boost :

Subject: Re: [boost] [chrono] type_traits/common_type and integer/ratio
From: John Maddock (john_at_[hidden])
Date: 2009-12-06 04:49:32


> I hav refactored boost/ratio;hpp to use math::static_gcd instead of the
> internal detail::static_gcd, and this is working now. In the detail
> implementation there was also the following metafunctions
>
> template <boost::intmax_t X>
> struct static_abs
> {
> static const boost::intmax_t value = X < 0 ? -X : X;
> };
>
> template <boost::intmax_t X>
> struct static_sign
> {
> static const boost::intmax_t value = X == 0 ? 0 : (X < 0 ? -1 : 1);
> };
>
>
> Is there something similar in Boost.Math or elsewhere?

Nope, but they might make reasonable additions... or maybe they would be
better in Boost.Integer I don't know?

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk