abs
Input Stack: |
⇨ |
Output Stack: |
Compute a new time series where each interval has the absolute value of the input time series.
This ensures all values are non-negative by converting negative values to positive while
leaving positive values unchanged.
Parameters
- expr: The time series expression to take the absolute value of
Examples
Demonstrating absolute value with different constant values:
This shows that :abs
converts 0 to 0, leaves positive values unchanged, and converts
negative values to positive.
- :neg - Negation (changes sign, compared to abs which removes sign)
- :sub - Subtraction (often used with abs for absolute differences)
- :add - Addition operation
- :mul - Multiplication operation