Boost logo

Boost :

From: Steve Ward (planet36_at_[hidden])
Date: 2008-03-01 13:56:10


On Wed, Feb 27, 2008 at 10:56 AM, Johan Råde <rade_at_[hidden]> wrote:

> John Maddock wrote:
>
> > There is one other useful function worth having IMO:
> >
> > template <class T>
> > int sign(T x);
> >
> > returns 0 (x is zero), +1 (x is > 0) or -1 (x is < 0). This is trivial
> to
> > implement (lot's of old C code - for example the Numerical Recipies
> stuff -
> > implement this as a helper macro), and there's an undocumented version
> > currently in Boost.Math. Is this worth integrating with Johan's code?
> I've
> > found it quite useful in Boost.Math from time to time.
>
> The library deals with signbits, not with signs.
> So I think that adding this function to the library would just create
> confusion.
> It may be a useful function, but I don't think it belongs here.
>
> --Johan
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

I agree.

Steve


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