Conversion to float array
kosik at fiit.stuba.sk
Sun Jan 1 21:40:16 UTC 2006
-----BEGIN PGP SIGNED MESSAGE-----
Cowdery, Bob [UK] wrote:
> I am reading a sequence of bytes from a pipe. The data is actually 32
> bit float values. Is there an easy and efficient way to convert the byte
> array to a float array. Just doing asFloatArray not surprisingly gives
> me an array with each byte converted to a float and what I want is each
> 4 bytes converted to a float.
> Any help appreciated.
If I had the testing file you have, I would try to do this:
Float fromIEEE32Bit: (Integer
byte1: stream next
byte2: stream next
byte3: stream next
byte4: stream next)
I assume that `stream next' gives me a single byte. But this need not be
the case. But you can try it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Squeak-dev