• Post Reply Bookmark Topic Watch Topic
  • New Topic

What does Integer.rotateLeft(i, 64); actually do??  RSS feed

 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does Integer.rotateLeft(i, 64); actually do??

I mean if it shifts bits how can we calculate that(assuming ourselves as Compilers)
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote:What does Integer.rotateLeft(i, 64); actually do??

Try it and see.

I mean if it shifts bits how can we calculate that(assuming ourselves as Compilers)


What do you mean?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lookup the rotateLeft() method in the API documentation of class Integer. Especially note this part:
Note also that rotation by any multiple of 32 is a no-op ...

 
Chandraprakash Sarathe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


here rotateLeft shifts the bit 2 position left.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!