A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Shift by -ve value
Joined: Jul 13, 2001
Jun 04, 2002 15:04:00
Why is the shift operation by a -ve value ,not a compiler error.(eg: 12 >> -2)?
It compiles fine and gives 0 as o/p.
Joined: Dec 20, 2001
Jun 04, 2002 15:10:00
Doing a shift by a negative number is not a compiler error. It is a legal operation in
. Do a search in this forum as this topic has been discussed many times.
SCJP Tipline, etc.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Shift by -ve value
Shift operators - question
shift operator 2>>-1 ???
shift operator ~
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014