I am trying to make an integer into a binary:
543 = <<"543">>
How can I do this without
integer_to_list(list_to_binary(K)).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to convert 543 to <<“543″>> I don’t think you can find something faster than:
Because in this case both functions implemented in C.
If you want to convert integer to the smallest possible binary representation you can use binary:encode_unsigned function from the new binary module like this: