[squeak-dev] Re: 32 bits single precision float number to a byte array

Andreas Raab andreas.raab at gmx.de
Thu Feb 26 09:15:36 UTC 2009


Serge Stinckwich wrote:
> There is a primitive failed in ByteArray>>integerAt:put:size:signed with 
>  your solution ...

Ah, yes. This is the platform specific access for FFI and friends.

> Seems to work if i add bigEndian:true :

You're right. That is the correct solution.

Cheers,
   - Andreas

> fltArray := FloatArray with: 42.0.
> word := fltArray basicAt: 1.
> bytes := (ByteArray new: 4) unsignedLongAt: 1 put: word bigEndian:true; 
> yourself.
> 
> Cheers,




More information about the Squeak-dev mailing list