Skip to content

Math.Subtract

Name Mandatory Description Default Type
⬅️ Input The value or the sequence of values to subtract the value specified in the Operand parameter from. IntInt2Int3Int4Int8Int16FloatFloat2Float3Float4Color[Any]
Output ➡️ This shard outputs the result of the subtraction. IntInt2Int3Int4Int8Int16FloatFloat2Float3Float4Color[Any]
Operand No The value or sequence of values to subtract from the input. 0 IntVar(Int)Int2Var(Int2)Int3Var(Int3)Int4Var(Int4)Int8Var(Int8)Int16Var(Int16)FloatVar(Float)Float2Var(Float2)Float3Var(Float3)Float4Var(Float4)ColorVar(Color)[Any]Var([Any])

This shard subtracts the value provided in the Operand parameter from the input value.

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
7 | Math.Subtract(Operand: 2) | Log
Assert.Is(5 Break: true)

[info] [sample-wire] 5