Skip to content

neg

Input Stack:
expr: TimeSeriesExpr
Output Stack:
TimeSeriesExpr

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:

064-64
0,:neg
64,:neg
-64,:neg

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