Serge Stinckwich wrote:
i'm looking for a way to convert a float (seen as a 32 bits single precision float number) as a byte array of length 4 ?
Given that there is no builtin 32bit single precision float type in Squeak, how is this float stored? If it's in a float array you can just get the bits out of it using #basicAt: and store that. E.g.,
fltArray := FloatArray with: 42.0. word := fltArray basicAt: 1. bytes := (ByteArray new: 4) unsignedLongAt: 1 put: word; yourself.
Cheers, - Andreas