[PD] Getting 32 bit floating point number from 4 sequential bytes

Roman Haefeli reduzent at gmail.com
Sat Apr 6 13:21:16 CEST 2019


On Sat, 2019-04-06 at 11:28 +0200, cyrille henry wrote:
> 
> 
> An other solution is to use bitwise operator :
> 
> my_float = (byte1 << 24) & (byte2 << 16) & (byte3 << 8) & byte4;

From what I understand, the result is not a 32 bit floating point
number, but a 32 bit unsigned int (assuming that each byte is an
unsigned 8 bit int).

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190406/66e92aeb/attachment.sig>


More information about the Pd-list mailing list