Converting Float to Hexadecimal

Converting a floating point number to hexadecimal

I'm trying to convert a floating point number (single precision). I want to show it's bit representation in hexadecimal, but I'm unsure on how to approach the problem. Any clues?

Hmm, I've somehow posted this in the C++ boards, how can I delete that thread?

Re: Converting Float to Hexadecimal

Quote:

*Originally posted by denizengt *

**Converting a floating point number to hexadecimal **

I'm trying to convert a floating point number (single precision). I want to show it's bit representation in hexadecimal, but I'm unsure on how to approach the problem. Any clues?

Hmm, I've somehow posted this in the C++ boards, how can I delete that thread?

Click on "Edit Post", check the delete box. Hit delete.

Back to your oringal issue: Don't. Why would you want to convert a floating point number to hex? There is no decimal in hex. Drop the decimal, make it integeral, and convert that way.

Or, multiply by ten, making it integral, conver to hex, and do the opposite when you convert back.

Quzah.