bug with >> (right shift) ?

Hi all,
Right Shift (or gcc or Eclipse) looks buggy. I put a breakpoint and evaluated these expressions in the Eclipse expression evaluator :
1
2
3
(1) 16 >> 3 = 2            OK
(2) ((2^42)-1) >> 9 = 0    KO
(3) ((2^42)-1)/(2^9) = 3   OK


(2) and (3) should give the same result.
(1) and (2) show that >> works in some case and not others.

So do I misuse it or is it a bug ?
^ is the bitwise xor operator. You can use std::pow instead.
Ooouups ! Many thanks Peter87.
Topic archived. No new replies allowed.