aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Hexa and octal values conversion to decimal integers, How? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Hexa and octal values conversion to decimal integers, How?" Watch "Hexa and octal values conversion to decimal integers, How?" New topic
Author

Hexa and octal values conversion to decimal integers, How?

Nikhitha Pai
Greenhorn

Joined: Sep 17, 2012
Posts: 19
Hi,
Often we find questions where they give octal or hexadecimal values and ask what is the resut of shift operations .
In such cases to evaluate the expression, how do you convert the hexadecimal and octal values to decimal equivalents manually, do the shift operations and get the answer . Could you please give an example.

Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18717
    
  40

Nikhitha Pai wrote:Hi,
Often we find questions where they give octal or hexadecimal values and ask what is the resut of shift operations .
In such cases to evaluate the expression, how do you convert the hexadecimal and octal values to decimal equivalents manually, do the shift operations and get the answer . Could you please give an example.


Not sure what you are asking here... except, IMO, it is easier to envision the shifting of octal and hexadecimal numbers, as the bit boundaries are easier to see. So, unless the question wants the result in decimal, why would you want to convert the number to decimal first? Also, on how to convert octal and hexadecimal numbers to decimal, that is standard base arithmetic that is taught in the eight grade (well, at least in the US, it is taught in the eight grade).

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hexa and octal values conversion to decimal integers, How?