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 Number input.

  • 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 Subtract block followed by this block.

  • Convert a signed error value into a magnitude for threshold checks or alerts.

πŸ’‘ Tips and Tricks

  • Combine with Subtract to get the magnitude of a difference (e.g., measurement vs. reference).

  • Use together with Greater or Smaller to compare magnitudes against thresholds.

  • Pipe the result into Round for human-friendly numeric displays or into CSV Export / Data Write Global for logging.

  • For flows that produce lists or batches of numbers, consider Batch Processing / Debatch to 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 None or Data Type Converter blocks upstream to validate or transform inputs into numeric form before applying the absolute operation.

Last updated

Was this helpful?