anchor.diff:  -spec log2(X::number()) -> float().
   log2(X) -> log(X, 2).
   
  -%% @doc Returns the largest integer not larger than X.
  +%% @doc Returns the largest integer not larger than X. 
   -spec floor(X::number()) -> integer().
   floor(X) when X >= 0 ->
       erlang:trunc(X);
  
positive.code: repeat(Fun, Args, Times, Params) ->
      NewParams = case proplists:is_defined(collect, Params) of
                      false -> Params;
                      _ -> [{accumulate, fun(I, R) -> [I | R] end, []} |
                                proplists:delete(accumulate, Params)]
                  end,
      Acc = lists:keyfind(accumulate, 1, NewParams),
      case proplists:is_defined(parallel, NewParams) of
          true ->
              repeat(fun spawn/3, [?MODULE, parallel_run, [self(), Fun, Args, Acc =/= false, ok]], Times),
              case Acc of
                  false -> ok;
  
negative.code:     Length = length(List) + 1,
      RandomNum = randoms:rand_uniform(1, Length),
      {lists:nth(RandomNum, List), Length - 1}.
      
  %% @doc Removes a random element from the (non-empty!) list and returns the
  %%      resulting list and the removed element.
  -spec pop_randomelem(List::[X,...]) -> {NewList::[X], PoppedElement::X}.
  pop_randomelem(List) ->
      pop_randomelem(List, length(List)).
      
  %% @doc Removes a random element from the first Size elements of a (non-empty!)
  %%      list and returns the resulting list and the removed element. 
  -spec pop_randomelem(List::[X,...], Size::non_neg_integer()) -> {NewList::[X], PoppedElement::X}.
  pop_randomelem(List, Size) ->
      {Leading, [H | T]} = lists:split(randoms:rand_uniform(0, Size), List),
  