neg
Input Stack: |
⇨ |
Output Stack: |
Compute a new time series where each interval has the negated value of the input time series.
This applies the unary minus operation, multiplying each value by -1.
Parameters
- expr: The time series expression to negate
Examples
Demonstrating negation with different constant values:
This shows that :neg
converts 0 to 0, positive values to negative, and negative values to positive.
- :abs - Absolute value (always positive)
- :sub - Subtraction (
:neg
is equivalent to 0,:swap,:sub
)
- :mul - Multiplication (
:neg
is equivalent to -1,:mul
)
- :add - Addition operation