Title: RE: Decimal to Hex or Bin Floating point conversion.

$Bill Luebkert [mailto:[EMAIL PROTECTED]]  wrote:
>
>       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;

Thanks for that Bill,

That's half of my job done! The next step would be a string representation of a 64 bit (in Hex).
I don't need to do any maths on the result just convert from one to the other.
EG.                                           
111190.741235  in double precision (64) hex = 40fb256bdc193b3a
or at least what Hex workshop and http://babage.cs.qc.edu/cources/cs341/IEEE-754.html.


Best regards,
Jim Power
BT Ignite Remote Access Service
Implementation Engineering and Network Change Control,

        telephone number +33 (0) 1 41 88 40 25
                fax number  +33 (0) 1 41 88 42 70
(A)bort, (R)etry, (T)ake down entire network?

My personal view and not does of my employer.
as if I would risk getting a bad rep by using the company's views!!!!




 

Reply via email to