How to build a binary of 1024 zeros?

Torbjorn Tornkvist <>
Mon May 29 13:33:58 CEST 2006


Andrew Lentvorski wrote:
> Is there an equivalent to lists:duplicate(1024, 0), but for binaries?

What about:

-define(BYTE, integer-unit:8).    % Nice syntactic sugar...

<<0:1024/?BYTE>>

--Tobbe




More information about the erlang-questions mailing list