
26 May
2006
26 May
'06
2:57 p.m.
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@poly.edu