functionmod2sign

Modulo-two sign

Extends from Icons.Function (Function icon).

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

Inputs

TypeNameDefaultDescription
Integerninteger vector

Outputs

TypeNameDefaultDescription
Integersign_n(-1)^n_k, k=1:size(n)