possiblt bug in #lowBit and #highBit

Douglas Brebner slate at fang.demon.co.uk
Fri Jan 7 11:19:25 PST 2005


I'm writing some bit manipulation code and think I've found a bug in
#lowBit and #highBit (from numeric.slate and integer.slate)

It appears that these methods don't handle the case of the integer = 0

Slate 69> 0 lowBit.
0
Slate 70> 1 lowBit.
0
Slate 71> 2 lowBit.
1
Slate 72> 4 lowBit.
2

and the same for highBit.

Any suggestions as to how they should handle this case?

-- 
Douglas




More information about the Slate mailing list