.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-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos