erlang float to bit syntax

I am new to erlang, can anybody explain, what happens in this code snippet?, I am following Programming Erlang software for concurrent world By Joe Armstrong.

$ <<2.03:64/float>>.

$ <<64,0,61,112,163,215,10,61>>

$ <<2.03:32/float>>.

$ <<64,1,235,133>>

If there is an answer already exists, kindly mark this is as duplicate, Thanks.

You create binaries with IEEE 754 encoded floats with sizes 64 and 32 bits. More about it you can find on Wikipedia.

1 Like