File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

shift operators

 
Richa Jeetah
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I know how each works...but i have some difficulty in calculating the values when given to actually solve a few examples.
whats the easiest way to calculate the answers for these operaators.
i read somewhere that
x << y can be interpreted as x*2^y
and x>>y as x/y ^2
how does it work ??
when i tried it ..... it gave diff results.
whats the best way to do it ??
if given : 8>>3
i try to convert it to binary and then perform the operation and convert it back..
it fine if the number is low...
but i fail to apply the same when given
24>>4 or 33>> 4 ... etc
Please Help !
 
Richa Jeetah
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx
it helped
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic