none
Converting Float to 32bit Integer(Hex)? RRS feed

  • Question

  • I need to convert Float value ( 0.1 as example ) to Hex (32bit) value (0x3DCCCCCD).
    How can i do it?
    Monday, January 1, 2007 5:23 PM

Answers

  • Hi,

    In case of converting int to hex is common to use String.Format("{0:x}",int)

    However, it seems no method going to do it directly, you must implement one yourself.

     

    Tuesday, January 2, 2007 4:18 AM

All replies

  • Hi,

    In case of converting int to hex is common to use String.Format("{0:x}",int)

    However, it seems no method going to do it directly, you must implement one yourself.

     

    Tuesday, January 2, 2007 4:18 AM
  • Hi,

    AFAIK, hex can be converted for "integer part" only. Its base 16 number and starts with 1 onwards...

    So i really have a doubt that logically its possible or not!

     

    Figo Fei,
    you suggested to write code for it but if you know, please tell me that how a float can be converted into Hex logically?

     

    Thanks,

    Tuesday, January 2, 2007 12:42 PM