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
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | integer vector |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | sign_n | (-1)^n_k, k=1:size(n) |