Re: retrieve bitwise float representation

2009-06-11 Thread Tom K.
On Jun 10, 8:41 am, Ulrich Eckhardt wrote: > I need to pack a floating point value into a vector of 32-bit unsigned > values in IEEE format. Further, I maintain a CRC32 checksum for integrity > checking. For the latter, I actually need the float as integral value. ... > What I'm wondering is wheth

Re: retrieve bitwise float representation

2009-06-10 Thread Scott David Daniels
Ulrich Eckhardt wrote: I need to pack a floating point value into a vector of 32-bit unsigned values in IEEE format. Further, I maintain a CRC32 checksum for integrity checking. For the latter, I actually need the float as integral value. What I currently do is ... pack and unpack the float usin

Re: retrieve bitwise float representation

2009-06-10 Thread Peter Otten
Ulrich Eckhardt wrote: > I need to pack a floating point value into a vector of 32-bit unsigned > values in IEEE format. Further, I maintain a CRC32 checksum for integrity > checking. For the latter, I actually need the float as integral value. > > What I currently do is this: > > tmp = struct

Re: retrieve bitwise float representation

2009-06-10 Thread Mark Dickinson
Ulrich Eckhardt wrote: > Hi! > > I need to pack a floating point value into a vector of 32-bit unsigned > values in IEEE format. Further, I maintain a CRC32 checksum for integrity > checking. For the latter, I actually need the float as integral value. > > [...] You could try using frexp to ext

retrieve bitwise float representation

2009-06-10 Thread Ulrich Eckhardt
Hi! I need to pack a floating point value into a vector of 32-bit unsigned values in IEEE format. Further, I maintain a CRC32 checksum for integrity checking. For the latter, I actually need the float as integral value. What I currently do is this: tmp = struct.pack("=f", f) (i,) = struct.un