anchor.diff:                        S#series{values=process_series_values(S#series.values, fun(X) -> X + Offset end)}
                 end, Series);
   
  +% offsetToZero
  +evaluate_call(<<"offsetToZero">>, [Series], _From, _Until, _Now) ->
  +    lists:map(fun(S) ->
  +                      Values = S#series.values,
  +                      Minimum = safe_minimum(Values),
  +                      S#series{values=process_series_values(Values, fun(X) -> X - Minimum end)}
  +              end, Series);
  +
   % removeAboveValue
   evaluate_call(<<"removeAboveValue">>, [Series, Val], _From, _Until, _Now) when is_number(Val) ->
       lists:map(fun(S) ->
  
positive.code:      ?_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([]))
      ].
  
  
negative.code: 
  safe_minimum([]) -> null;
  safe_minimum(Values) ->
      safe_minimum(Values, null).
  
  safe_minimum([], Min) -> Min;
  safe_minimum([{_TS, null} | Vs], Min) ->
      safe_minimum(Vs, Min);
  safe_minimum([{_TS, Value} | Vs], Min) ->
      safe_minimum(Vs, safe_minimum0(Min, Value));
  safe_minimum([null | Vs], Min) ->
      safe_minimum(Vs, Min);
  safe_minimum([Value | Vs], Min) ->
      safe_minimum(Vs, safe_minimum0(Min, Value)).
  
  
  safe_minimum0(null, Value) -> Value;
  safe_minimum0(Value, null) -> Value;
  safe_minimum0(A, B) -> min(A, B).
  
  
  square_sum([]) -> 0;
  