[erlang-patches] [patch] binary to/from integer

Anthony Ramine <>
Fri Jan 11 11:42:45 CET 2013


I disagree. Making it the big endian encoding of that integer is something
that is already covered by OTP (binary:encode_unsigned/1 and its friends),
and as you say, it's a *encoding* operation, not a type conversion. Naming
this new BIF "integer_to_binary" isn't more confusing than "atom_to_binary".

-- 
Anthony Ramine

Le 10 janv. 2013 à 23:13, Bob Ippolito a écrit :

> The purpose of integer_to_binary still isn't totally obvious from the name or output type, maybe it's digits, maybe it's the big endian encoding of that integer (which is closer to the behavior of binary_to_term / term_to_binary). For the more seasoned Erlang developer, I think they would expect it to behave like integer_to_string, but what about newer users?



More information about the erlang-patches mailing list