Absolute

Arithmetic Pure Generic
Absolute
Value 0
Result

Description

Pure function returning the absolute value of a number.

When to use

Use Absolute whenever you need to measure a magnitude regardless of sign — for example, computing the distance between two values by subtracting and then taking the absolute value. Both integer and decimal inputs are accepted. It is also useful to normalize input that may arrive as either positive or negative before passing it into Clamp or a comparison node.

Pins

Input pins

Pin Type Default Notes
Value generic(integer, decimal) 0 The number whose absolute value is returned.

Output pins

Pin Type Notes
Result generic(integer, decimal) The absolute (non-negative) value of the input.

Example

Compute the distance between two numeric positions. Wire the two position values (integer or decimal) into the A and B inputs of Subtract, then feed the Result output into the Value input of Absolute. The Result output of Absolute is always non-negative regardless of which position is larger.

See also