Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Octal

 
Gautam Sewani
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanna know how to convert octal to decimal
and decimal to octal
and I also wanna know how to convert octal to binary and binary to octal
and how to convert hex to decimal and decimal to hex and hex to binary and binary to hex,
Where should I look for it?
 
La Vish
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gautam,
Just use the search facility on top and type in Octal and press enter and you will find this subject discussed over and over again in this forum.
Good luck
[ May 08, 2002: Message edited by: La Vish ]
 
Gautam Sewani
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we wanna do some bit shifting on an octal number manually,then we'll have to first convert it into a binary no. and then perform the shifting.
if a binary no. is like this:
00000011
then >>2 would mean:
11000000
coz 1 is shifted right,and other 1 is shifted right
IF i m wrong pls correct me
Thanks
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gautam,
when you're doing bit shifting, the bits at the end (in the case of right shifting, >> ) are not rotated, as in your example, but simply fall off. Therefore:
0000 0011 >> 2 becomes 0000 0000 (which is zero).
Whether you have an octal, a decimal, a hexadecimal or even a binary number does not matter - internally they are all represented as binary numbers.
If in doubt, ask your compiler.
[ May 08, 2002: Message edited by: Mag Hoehme ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic