unsigned long to float.
lbates at swamisoft.com
Mon Sep 20 17:42:34 CEST 2004
Use struct.unpack to convert into a float.
"kingjames" <jf.davis at ngc.com> wrote in message
news:cimsoo$e6b$1 at gateway.northropgrumman.com...
>I have a c30 to ieee float converter algorithm that takes binary data from
> c30, does some bit munipulation and stores the answer (i'm using unsigned
> longs for the processing). When I come up with the answer, if I was in C
> Fortran, I could use either a union or equivalence to see the number in
> floating point rather than the representation in unsigned long. I have
> found no equivalence in python of union or equvalence. I could take the
> unsigned long, write it to a binary file and read it back in as a float.
> This would work, accept I do not want the overhead of io. What can I do
> see this unsigned long as a float?
More information about the Python-list