Math.Mod¶
Name | Mandatory | Description | Default | Type |
---|---|---|---|---|
⬅️ Input |
The value or the sequence of values to divide the value specified in the Operand parameter with. | Int Int2 Int3 Int4 Int8 Int16 Float Float2 Float3 Float4 Color [Any] |
||
Output ➡️ |
This shard outputs the result of the modulus operation. | Int Int2 Int3 Int4 Int8 Int16 Float Float2 Float3 Float4 Color [Any] |
||
Operand |
No | The value or sequence of values to divide the input by and get the remainder of. | 0 |
Int Var(Int) Int2 Var(Int2) Int3 Var(Int3) Int4 Var(Int4) Int8 Var(Int8) Int16 Var(Int16) Float Var(Float) Float2 Var(Float2) Float3 Var(Float3) Float4 Var(Float4) Color Var(Color) [Any] Var([Any]) |
This shard calculates the remainder of the division of the input value by the value provided in the Operand parameter.
Details¶
This shard can take an integer or a sequence of integers as input. However, depending on the type of input, the appropriate Operand
needs to be provided:
For non-sequence inputs: The Operand
must match the input type exactly (e.g., Int2 with Int2, Color with Color).
For sequence inputs: The Operand
can be either:
- A matching non-sequence type (e.g., sequence of Int2 with a single Int2 Operand
). Each element of the input sequence is operated on by the Operand
.
- Another sequence of elements with the same types. Each element of the Operand
sequence is applied to the corresponding element of the input sequence. If the input sequence is longer, the Operand
sequence will loop over till all elements of the input sequence are operated on. If the Operand
sequence is longer, the extra elements of the Operand
sequence are ignored.
Examples¶
1 2 |
|
[info] [sample-wire] @i4(1 0 1 0)