.PowerSystems.Utilities.Math.mod2sign

Information

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

Interface

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;

Generated at 2025-01-04T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos