.Spot.Base.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 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 2024-03-28T19:15:55Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos