anchor.diff:      safe_average(Vs, Cnt + 1, NewAvg).
   
   
  +safe_invert(null) -> null;
  +safe_invert(Value) -> math:pow(Value, -1).
  +
  +
  +safe_square_root(null) -> null;
  +safe_square_root(Value) -> math:pow(Value, 0.5).
  +
  +
   derivative(Values) ->
       derivative(Values, null, []).
   
  
positive.code:                       S#series{values=Values}
                end, Series);
  
  % removeAboveValue
  evaluate_call(<<"removeAboveValue">>, [Series, Val], _From, _Until, _Now) when is_number(Val) ->
      lists:map(fun(S) ->
  
negative.code:     [?_assertEqual(0, square_sum([])),
       ?_assertEqual(2/3, square_sum([3, 4, 5])),
       ?_assertEqual(0.0, square_sum([3, 3, null, 3, null]))
      ].
  
  minimum_test_() ->
      [?_assertEqual(0, safe_minimum([23, 0])),
       ?_assertEqual(0, safe_minimum([23, 0, 1, null])),
       ?_assertEqual(-1, safe_minimum([null, 0, -1, null])),
       ?_assertEqual(-1, safe_minimum(pseudo_values([null, 0, -1, null]))),
       ?_assertEqual(null, safe_minimum([]))
      ].
  
  percentile_test_() ->
  