0

Possible Duplicate:
How to convert hex string to float in Java?

i want to convert hexadecimal value into equivalent float value in java.

Ex.What is the output of 000C (hexa value) ?

Thanks in advance..

Community
  • 1
  • 1
Babu R
  • 1,025
  • 8
  • 20
  • 40
  • Check this : stackoverflow.com/questions/1071904/how-to-convert-hex-string-to-float-in-java – Ajinkya Jun 22 '12 at 05:55
  • You need to say what the input value is supposed to be. Is `000C` an integer? A bitwise representation of a float? IEE format? 4 hex digits gives just 2 bytes which is too small for a bitwise representation of an IEE 32-bit float. – Stephen C Jun 22 '12 at 05:57
  • yes it is string object. – Babu R Jun 22 '12 at 06:06

1 Answers1

0

Read the hex as an integer and use intBitsToFloat.

trutheality
  • 23,114
  • 6
  • 54
  • 68