Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hex, Octal conversion

 
John Anderson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, I am taking the text Tuesday...
I can not find any info on how to convert a decimal to an Octal or Hex. I understand how to convert an Octal or Hex to decimal.
Could someone shed some light on this for me?
Thanks!
 
Neelima Rao
Greenhorn
Posts: 26
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shrink182,
I'd like you to read the Javaranch Naming Policy and change your publicly displayed name to comply with our unique rule. Thank you.
[ April 12, 2002: Message edited by: Valentin Crettaz ]
 
Suman Dass
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pl search the web or look into any standard math book. best of luck for the exams!!!
 
vinita Kh
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a short cut way to convert decimal to Hex or Oct
lets convert decimal 300 to Hex ---
300/16 result->18 Rest ->12 write rest in Hex -> C
18/16 result->1 Rest ->2 Write rest in Hex -> 2
1/16 result ->0 Rest ->1 Write rest in Hex -> 1
resverse hex digits thus obtained ie ->12C
hence
300(decimal) = 12C (Hex)
similarly replace 16 with 8 to convert to octal
Cheers..
Vinita
 
John Anderson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help guys, that info should do the trick. Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic