|
Boost : |
From: Maarten Kronenburg (M.Kronenburg_at_[hidden])
Date: 2006-05-26 11:05:52
OK, I will keep is_odd(),
and delete is_even() because
it is equal to !is_odd().
Is this OK with you?
Regards, Maarten.
"Hervé Brönnimann" <hbr_at_[hidden]> wrote in message
news:77875A54-ED2A-4BC5-A840-522E3723B72D_at_poly.edu...
> The counting starts with bit number 0.
> So is_odd now becomes lowest_bit() == 0.
But isn't lowest_bit() != 0 an overkill for checking that a number is
even? (I mean, first computing the order of the lowest_bit, then
comparing to 0...) I think there is room for lowest_bit /
highest_bit as well as for is_odd and is_even. Perhaps it will be
more readable than the idiom "integer(x) %2 == 0".
-- Hervé Brönnimann CIS, Polytechnic University hbr_at_[hidden] _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk