programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Paul Clapham
• Ron McLeod
• Bear Bibeault
• Liutauras Vilda
Sheriffs:
• Jeanne Boyarsky
• Junilu Lacar
• Henry Wong
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Jj Roberts
• Tim Holloway
• Piet Souris
Bartenders:
• Himai Minh
• Carey Brown
• salvin francis

# operator

Ranch Hand
Posts: 481
Here we know that for >> we use formula as x/2topower of n and for << we use x * 2to power of n

then how we use this for the following one.

Ranch Hand
Posts: 59
Hello karthik,
I cannot understand what you are trying to say. But I want to clarify if you don't know.

int b = 127;
b>>i --> b/(2 pow i);
b<<i --> b * (2 pow i);

So if b <<33 it is b * (2 pow 33);

Ranch Hand
Posts: 411

Originally posted by Karthik Rajashekaran:
Here we know that for >> we use formula as x/2topower of n and for << we use x * 2to power of n

then how we use this for the following one.

b << 33 is equivalent to b << ( 33 % 32) i.e b << 1

author
Posts: 9000
19
just remember this is a topic on the 1.4 exam, but it's NOT on the tiger exam!

 Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one: Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton