• Post Reply Bookmark Topic Watch Topic
  • New Topic
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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

>>

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Result of 0x800028FF >> 3
Options are:
1. 0x900005FF
2. 0x1000051F
3. 0x1000011F
4. 0x9000051F
Answer given is 0x9000051F.
How do we get 9? Can somebody please explain?
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ash,
the answer might be wrong. isn't F000051F ?
rajani
[This message has been edited by rajani peddi (edited December 19, 2000).]
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the answer should be
0x1000051F
I followed the following way to derive the asnwer
0x800028FF is 1000 0000 0000 0000 0010 1000 1111 1111
this shifted >> 3 gives
0001 0000 0000 0000 0000 0101 0001 1111
which is
0x1000051F
 
rajani peddi
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Axl Rose:
I think the answer should be
0x1000051F
I followed the following way to derive the asnwer
0x800028FF is 1000 0000 0000 0000 0010 1000 1111 1111
this shifted >> 3 gives
0001 0000 0000 0000 0000 0101 0001 1111
which is
0x1000051F



Axl Rose,
>> is a signed shift operator. Hence when we have 1 in MSB the newly added bits on the left should be 1's and so we get an F but not 1.
rajani
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes i also think the answer should be F000051F .... because >> is a signed operator there is no way there is 9 can be the first digit.
 
eat bricks! HA! And here's another one! And a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic