Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting to another type

 
vijaya dev
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Is there an easy way to convert a big binary number to an integer or long and viceversa. For example given a number
10000000 00000000 00000000 00000101 (-2147483643)
Is there an easy way to do this and Will the Java certification have number like this in any of the questions and require us to convert into another type.

Thanks,
Vijaya
 
Swamy Nathan
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am no expert on this. I did some study into this. I am told it was unnecessary and the exam is simpler.

Link
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Conversions between binary and decimal are not a lot of fun, but conversions between binary, octal and hexadecimal are very easy.

The exam is not designed to be a math test, so you won't see any questions that give you a binary value and ask you to convert it to decimal. You might find some binary, octal or hexadecimal values on the exam; so it would be a good idea to make sure that you understand what those values represent. Understanding binary values is also helpful when you are working with the shift operators.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems to be coming up often, so I've added a post about this to my blog. You can read it here, if you'd like.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic