Math
Arithmetic, rounding, interpolation, range mapping, and random number generation nodes.
Math nodes perform numeric computations — from basic arithmetic to interpolation, clamping, and random number generation. All Math nodes are pure (blue header, no execution pins). They evaluate inline whenever a downstream node reads their output.
Add
Add two numbers.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | First operand |
| B | Input | Float | Second operand |
| Result | Output | Float | Sum of A and B |
Pure. Use Add to combine numeric values — totaling scores, calculating offsets, or building sums.
Subtract
Subtract B from A.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | First operand |
| B | Input | Float | Second operand |
| Result | Output | Float | A minus B |
Pure. Use Subtract to compute differences — time deltas, remaining capacity, or balance changes.
Multiply
Multiply two numbers.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | First operand |
| B | Input | Float | Second operand |
| Result | Output | Float | Product of A and B |
Pure. Use Multiply for scaling values, computing areas, or applying percentage multipliers.
Divide
Divide A by B.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | Dividend |
| B | Input | Float | Divisor |
| Result | Output | Float | A divided by B |
Pure. Use Divide for calculating averages, ratios, or per-unit costs.
Modulo
Get the remainder of dividing A by B.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | Dividend |
| B | Input | Float | Divisor |
| Result | Output | Float | Remainder of A / B |
Pure. Use Modulo for cycling values, checking even/odd, or distributing items across buckets.
Power
Raise a number to a power.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Base | Input | Float | The base number |
| Exponent | Input | Float | The exponent |
| Result | Output | Float | Base raised to Exponent |
Pure. Use Power for exponential calculations — compound growth, squared distances, or backoff multipliers.
Absolute Value
Get the absolute (non-negative) value of a number.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The input number |
| Result | Output | Float | Absolute value |
Pure. Use Absolute Value to ensure a result is positive — computing distances or magnitudes regardless of sign.
Round
Round a number to a specified number of decimal places.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number to round |
| Decimals | Input | Integer | Decimal places (default: 0) |
| Result | Output | Float | Rounded value |
Pure. Use Round to clean up floating-point results for display or comparison.
Floor
Round down to the nearest integer.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number to floor |
| Result | Output | Integer | Largest integer less than or equal to Value |
Pure. Use Floor to truncate decimal values downward — calculating page numbers or whole-unit quantities.
Ceil
Round up to the nearest integer.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number to ceil |
| Result | Output | Integer | Smallest integer greater than or equal to Value |
Pure. Use Ceil to round up — calculating how many batches are needed to cover all items.
Min
Get the smallest value in an array.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Array | Input | Array | Array of numbers |
| Result | Output | Float | The smallest value |
Pure. Use Min to find the lowest score, earliest timestamp as epoch, or minimum threshold.
Max
Get the largest value in an array.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Array | Input | Array | Array of numbers |
| Result | Output | Float | The largest value |
Pure. Use Max to find the highest severity, latest value, or maximum reading.
Clamp
Constrain a value within a minimum and maximum range.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The value to clamp |
| Min | Input | Float | Lower bound (default: 0) |
| Max | Input | Float | Upper bound (default: 1) |
| Result | Output | Float | Value clamped to [Min, Max] |
Pure. Use Clamp to enforce boundaries — keeping a confidence score between 0 and 100, or limiting retry counts.
Map Range
Remap a value from one numeric range to another.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The value to remap |
| In Min | Input | Float | Source range minimum (default: 0) |
| In Max | Input | Float | Source range maximum (default: 1) |
| Out Min | Input | Float | Target range minimum (default: 0) |
| Out Max | Input | Float | Target range maximum (default: 100) |
| Result | Output | Float | Remapped value |
Pure. Use Map Range to convert between scales — normalizing sensor readings or converting scores to percentages.
Lerp
Linear interpolation between two values.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | Start value |
| B | Input | Float | End value |
| Alpha | Input | Float | Interpolation factor 0-1 (default: 0.5) |
| Result | Output | Float | Interpolated value |
Pure. Use Lerp to blend between two values — transitioning thresholds or computing weighted averages.
Inverse Lerp
Find the alpha position of a value between two bounds. The inverse of Lerp.
| Pin | Direction | Type | Description |
|---|---|---|---|
| A | Input | Float | Lower bound |
| B | Input | Float | Upper bound |
| Value | Input | Float | The value to locate |
| Result | Output | Float | Alpha position (0 = at A, 1 = at B) |
Pure. Use Inverse Lerp to determine where a value falls within a known range.
Negate
Flip the sign of a number.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number to negate |
| Result | Output | Float | Value with opposite sign |
Pure. Use Negate to reverse direction or convert between positive and negative representations.
Sign
Get the sign of a number as -1, 0, or 1.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number to check |
| Result | Output | Integer | -1 (negative), 0 (zero), or 1 (positive) |
Pure. Use Sign to determine direction or classify a value as negative, zero, or positive.
Square Root
Calculate the square root of a number.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number |
| Result | Output | Float | Square root of Value |
Pure. Use Square Root for distance calculations or mathematical formulas.
Logarithm
Calculate the logarithm of a value with a configurable base.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The number |
| Base | Input | Float | Logarithm base (default: 10) |
| Result | Output | Float | Logarithm of Value |
Pure. Use Logarithm for exponential decay calculations, scoring algorithms, or data normalization.
Random
Generate a random integer within a range (inclusive).
| Pin | Direction | Type | Description |
|---|---|---|---|
| Min | Input | Integer | Lower bound (default: 0) |
| Max | Input | Integer | Upper bound (default: 100) |
| Result | Output | Integer | Random integer in [Min, Max] |
Pure. Use Random for jitter in retry delays, selecting random samples, or generating test data.
Snap
Snap a value to the nearest multiple of a step size.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The value to snap |
| Step | Input | Float | Step size (default: 1) |
| Result | Output | Float | Nearest multiple of Step |
Pure. Use Snap to quantize values — rounding timestamps to the nearest minute or prices to the nearest cent.
Wrap
Wrap a value around a range using modular arithmetic.
| Pin | Direction | Type | Description |
|---|---|---|---|
| Value | Input | Float | The value to wrap |
| Min | Input | Float | Range minimum (default: 0) |
| Max | Input | Float | Range maximum (default: 360) |
| Result | Output | Float | Value wrapped into [Min, Max) |
Pure. Use Wrap for cyclic values — keeping angles within 0-360 or hours within 0-24.
Related categories
- Comparison — compare computed math results to thresholds
- Type Conversion — convert between integers, floats, and strings
- Array — use math results with array operations like sort or reduce