anchor.diff:  %% @doc
   %% Return the number of pieces that are members of the set.
   %% @end
  --spec size(pieceset()) -> pos_integer().
  +-spec size(pieceset()) -> non_neg_integer().
   size(Pieceset) ->
       #pieceset{elements=Elements} = Pieceset,
       size(Elements, 0).
  
positive.code: %% Create an empty set of piece indexes. The set of pieces
  %% is limited to contain pieces indexes from 0 to Size-1.
  %% @end
  -spec new(pos_integer()) -> pieceset().
  new(Size) ->
      PaddingLen = paddinglen(Size),
      Elements = <<0:Size, 0:PaddingLen>>,
  
negative.code: %% false if not. If the piece index is negative or is larger
  %% than the size of this piece set, the function exits with badarg.
  %% @end
  -spec is_member(non_neg_integer(), pieceset()) -> boolean().
  is_member(PieceIndex, _) when PieceIndex < 0 ->
      error(badarg);
  is_member(PieceIndex, Pieceset) ->
  