I've a
string say for example "C2A6AB4B". This is a little endian representation of a float number. How do I get the float out of it using
java code?
here is my futile try:
public class Hextofloat implements Serializable
{
private float number =0;
private String hexmsg = null;
private int temp=0;
public float hex2float (String hexMsg){
for(int i=8;i>0;i=i-2){
temp=Integer.parseInt(hexMsg.substring(i-2,i).trim(),16);
number = (number | temp)<<8;
}
return number;
}
}
it gives error message on the line "number =(number | temp)<<8; saying that the "|" is not defined for float, int. I tried (float, float) same thing.
can someone please help with it or give me a function or something that will do the trick?
thanks a lot in advanced.
[ October 06, 2005: Message edited by: Cowboy Drinkalot ]