Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Converting a Hexadecimal to a Double - using 0xFFFFFFFF Format

807589Jul 21 2008 — edited Jul 21 2008
Hello everyone,

I need some assistance in converting a hexadecimal with the format of 0xABCD to a decimal value (particularly a Double). The reason why a double is because some hexadecimal representations can be very large and will not fit inside of an Integer. This can cause a bad number Format Exception. I am already aware of the methods:
String hexValue = "0xFFFFFFFFFFFFFFFF";

Integer.decode(hexValue)

and

Integer.parseInt(hexValue, 16)
However, I can't seem to find one for Double. I would like to encompass the value of for instance 0xFFFFFFFFFFFFFFFF into a double variable. Doing Integer.decode("0xFFFFFFFFFFFFFFFF") causes an exception because the integer is not large enough. Please let me know any suggestions or advice.

Thanks in advance!
Brian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2008
Added on Jul 21 2008
3 comments
1,348 views