[erlang-questions] Mystery float binary matching

Michael Uvarov freeakk@REDACTED
Wed Jun 27 21:53:51 CEST 2012


I use this:

   try
       <<Value:native-float, Bin2/binary>> = Bin,
       {Value, Bin2};
    catch error:{badmatch, _Bin} ->
        BitCount = bit_size(<<0/native-float>>),
        <<_Skip:BitCount, Bin2/binary>> = Bin,
        {undefined, Bin2}
    end.



More information about the erlang-questions mailing list