# HOw to convert float32 to hex?

1. ## float32

Hi everybody,
i have min 0 and max 20
The value 0,1 is what in hex?

How is the way of calculation?

Dos excel support this?

Thanks
BR
Vauxdvihl

•

2. ## float32 hex

Hexadecimal notation doesn't support fractional numbers - only whole numbers.

•

3. ## dec2hex excel

Vauxdvihl,
Multiply 0,1 By 2^32 in decimal. The result is 429496729.6
.
Round the result to an integer. The result is 429496730.
.
Convert the integer result to Hex. The result is 1999999A.
.
The result is the base 32 representation of the fraction with the MSB having a weighting of 0,5.
.
Excel has a function "DEC2HEX" That converts decimal to hex. So you would do the multiplication and rounding in Excel, and then use "=DEC2HEX(429496730,8) to get the final result.
.
You must install the Excel Analysis Tool Pack in order to get the function "DEC2HEX" in Excel:
.
In the Add-Ins available list, select the Analysis ToolPak box, and then click OK.
If necessary, follow the instructions in the setup program.
Regards,
Kral

I'm not sure how the smiley face got into the reply. It should read =DEC2HEX(429496730,8)

It got in there again! the characters after the comma should be 8). Can anybody help me on this?

One more try! The characters after the comma should be the numeral 8 followed by a right parentesis. Help!!

•

4. ## excel dec2hex install

Either avoid smiley character combinations in your post, e.g. inserting a space between "8" and ")", or select "Disable Smilies in this post".

5. ## what is float32

Fvm,
Thanks for the Smiley Face tip!
Regards,
Kral

6. ## float32 to hex

The ranges 0 -20 must not be considered?
Thanks

Added after 2 hours 45 minutes:

It is very strange, because your result does not match with
http://www.h-schmidt.net/FloatApplet/IEEE754.html

Enter value 0,1 and you receive another value then you provided one.

Also a kollege is sending me this information:
mit 32bit ist bei
Min: 0 und
Max: 20.0
eine Auflösung von: 0,000000004656612873077392578125 möglich (0 bis 4294967295).
Das bedeutet 20 entspricht 4294967295 = 11111111111111111111111111111111 = FFFFFFFFhex.
Das bedeutet 0 entspricht 0 = 00000000000000000000000000000000 = 00000000hex.
Das bedeutet 0,1 entspricht 21474836 = 1010001111010111000010100 = 147AE14hex

I am lost, what is right?
Thanks

•

7. ## float32 ieee

Vauxdvihl,
The algorithm I gave is strictly for converting a decimal fraction to a hex representation. If you want to convert to IEEE-754 you must do the additional work of incorporating the "invisible" leading 1, the sign and the exponent.
Regards,
Kral

For an example of the conversion process, see the article at:
.
http://people.rit.edu/jdweme/labview...Conversion.pdf

8. ## how to convert decimal to ieee 754 hexadecimal

I need it for a µC Star12 from Freescale XET device
Thanks
BR
Sascha

I was not aware that there are different standards of converting a number

--[[ ]]--