[erlang-questions] float_to_binary?

Steve Davis steven.charles.davis@REDACTED
Tue Jan 27 14:18:24 CET 2009


Oh yea :)
... the bit syntax is wonderful.

Thanks both for the responses and the extra tips.

Here's what I now have...

binary(X) when is_integer(X) -> <<X:32>>;
binary(X) when is_float(X) -> <<X:64/float>>; % 64-bit IEEE

...which covers the base cases for me.

Best regards,
Steve



More information about the erlang-questions mailing list