is ther any function in c or vc++ to convert the hex value to floating point value as per ieee format. i searched google but confused with the result what actuallt they do.
Hex to IEEE format
Collapse
X
-
Tags: None
-
Use a stringstream:
[code=cpp]
stringstream ss;
ss << 0X1A;
double result;
ss >> result;
cout << result << endl;
//Or use a string
ss.flush();
string str("0x1A");
ss << str;
ss >> result;
cout << result << endl;
[/code] -
Hi,
Thanks for ur reply. But u havent mentioned what is the value of result and i hope the ss is the hex format value.Comment
-
result is a double. The hex value is in the double.
ss is a stringstream object. You may want to refresh your memory about this type.
Try the code.Comment
Comment