Abs
Absolute value of a number. Drops the sign.
Category: Math Returns: matches the input type; see overloads.
Signature
Abs(value)
The runtime picks the overload that matches the argument type at evaluation time.
Overloads
| Args | Returns | Notes |
|---|---|---|
(int) | int | Integer input; integer result. |
(decimal) | decimal | Decimal input; decimal result. |
(number) | number | Fallback when the input type can’t be statically resolved (variable inputs). |
Examples
Abs(trust_change) // magnitude of a change, ignoring direction
Abs(player_x - target_x) < 3 // within 3 units on the X axis
Abs(-7) // 7