I need help with finding algorithm converting hex to IEEE-754 single-precision floating point number (without coding). I couldn't find any on the internet :(
For example, given input string 0xB9CD542, we need to return string 0x1.39aa84p-104 where last number is in hexadecimal exponential form (single precision floating point number) rounded to 0
0x3f800000and want to determine its numeric value, 1.0 in this case? If so, there are tools for that, e.g. this randomly selected website. There are also numerous websites explaining the format, e.g. this randomly selected one – njuffa Mar 09 '24 at 22:21B9CD54, we need to return string0x1.39aa84p-104where last number is in hexadecimal exponential form (single precision floating point number) rounded to 0 – regina Mar 09 '24 at 22:240xB9CD54to0x1.39aa84p-104is not a math problem, so this looks like a programming question suitable for Stackoverflow. There should be no rounding (including truncation = round-toward-zero) involved when representing an IEEE-754 operand as a hex float. FWIW, as someone who does these kind of representation changes and conversions almost every day, I do not see how0xB9CD54maps to0x1.39aa84p-104. Did you mean0xb9cd542? – njuffa Mar 09 '24 at 22:41