Power, Jim (CRTEU) wrote:
Hello Everyone,

I need convert from decimal to hex floating point ( ieee 754 format).

Decimal 156.256 equals hexadecimal 431c4189 in 32bit floating.

I can do by hand or Hex calculator, I was hoping to find a module or script that does this before doing the coding myself.

Is there a script or module that will do this?
This works on an x86 architecture:

printf "%08x\n", unpack 'I', pack 'f', 156.256;

--
  ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
 (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to