Calculates the modulo_2 sign of the integer input vector n, with the following definition:
sign[k] = +1 if n[k] is even sign[k] = -1 if n[k] is odd
function mod2sign extends Modelica.Icons.Function; input Integer[:] n "integer vector"; output Integer[size(n, 1)] sign_n "(-1)^n_k, k=1:size(n)"; end mod2sign;