Absolute
This function block returns the absolute value of a numeric input. It is useful whenever you need the magnitude of a number regardless of its sign (for example, distances, error magnitudes, or differences).
π₯ Inputs
Number β A single numeric value (positive, negative, or zero).
π€ Outputs
Number β The absolute value of the input (non-negative).
πΉοΈ Controls
This function block has no interactive controls.
βοΈ Running mechanism
When the block runs, it reads the value provided on the Number input and outputs its magnitude on the Number output. If the input is negative, the output becomes its positive counterpart; otherwise the value is passed through unchanged.
π― Features
Simple and deterministic: always produces a non-negative numeric result.
Lightweight: suitable to use in real-time or low-latency setups.
Safe to chain: works reliably with single numeric values or results from other mathematical blocks.
π Usage
Connect any numeric-producing block (sensor readings, calculations, counters) to the
Numberinput.Use the output value wherever you need a magnitude without sign (e.g., comparison, formatting, logging).
Common examples:
Compute the absolute difference between two values by using the
Subtractblock followed by this block.Convert a signed error value into a magnitude for threshold checks or alerts.
π‘ Tips and Tricks
Combine with
Subtractto get the magnitude of a difference (e.g., measurement vs. reference).Use together with
GreaterorSmallerto compare magnitudes against thresholds.Pipe the result into
Roundfor human-friendly numeric displays or intoCSV Export/Data Write Globalfor logging.For flows that produce lists or batches of numbers, consider
Batch Processing/Debatchto handle values before applying the absolute block.
(hint: available related blocks you can combine with: Add, Subtract, Multiply, Divide, Round, Square Root, Maximum, Minimum, Greater, Smaller, CSV Export)
π οΈ Troubleshooting
If the output is unexpected, check the upstream block to ensure it is sending a numeric value (not empty or None).
Use
Is NoneorData Type Converterblocks upstream to validate or transform inputs into numeric form before applying the absolute operation.
Last updated
Was this helpful?