Comparison Operation¶
Performs numeric comparisons and clamping between two floating-point values. It returns both a numeric result and a boolean indicating the outcome of comparison-type operations. Supports min, max, clamping, and relational checks with a small tolerance for equality.

Usage¶
Use this node to select min/max values, clamp a value within bounds, or to evaluate relational conditions that can drive downstream logic (e.g., gating branches). For comparison modes, the boolean output indicates whether the relation holds, while the numeric output mirrors 'a' when true and 0.0 when false.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| a | True | FLOAT | Primary numeric input to compare or clamp. For comparison modes, this is the value returned when the comparison is true. | 3.14 |
| b | True | FLOAT | Secondary numeric input used for min/max selection and for all relational comparisons against 'a'. Not used when operation is 'clamp'. | 2.0 |
| operation | True | ["min", "max", "clamp", "equal", "greater", "less", "greater_equal", "less_equal"] | Selects the operation to perform. 'min'/'max' choose between a and b. 'clamp' bounds 'a' between clamp_min and clamp_max. Relational operations evaluate the relationship between a and b. | greater_equal |
| clamp_min | True | FLOAT | Lower bound used only when operation is 'clamp'. Ensures the result is not less than this value. | 0.0 |
| clamp_max | True | FLOAT | Upper bound used only when operation is 'clamp'. Ensures the result is not greater than this value. | 1.0 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| result | FLOAT | Numeric outcome. For min/max: the selected value. For clamp: 'a' clamped to [clamp_min, clamp_max]. For comparisons: returns 'a' if the condition is true, otherwise 0.0. | 3.14 |
| comparison_result | BOOLEAN | Boolean outcome for comparison modes (equal/greater/less/greater_equal/less_equal). For min/max/clamp, this is always False. | True |
Important Notes¶
- Tolerance for equality: 'equal' uses an absolute tolerance of 1e-9 when comparing a and b.
- Result behavior on comparisons: For relational operations, the numeric 'result' equals 'a' when the condition is true; otherwise it is 0.0.
- Clamp ignores b: In 'clamp' mode, only 'a', 'clamp_min', and 'clamp_max' are used; 'b' is ignored.
- Bounds and precision: Inputs accept FLOAT values approximately within [-1e10, 1e10] with step 0.001.
- Boolean for non-comparison modes: 'comparison_result' is always False for 'min', 'max', and 'clamp'.
Troubleshooting¶
- Unexpected 0.0 result: In comparison modes, this indicates the condition evaluated to False. Verify 'a' and 'b' or choose a different operation.
- Equality false due to tiny differences: 'equal' uses a 1e-9 tolerance. If your values differ beyond that, they won't be considered equal. Adjust inputs or handle tolerance upstream.
- Clamp not behaving as expected: Ensure clamp_min <= clamp_max. Reversed bounds can yield unintuitive results due to the max(min()) logic.
- Boolean always False: This is expected for 'min', 'max', and 'clamp'. Use a relational operation if you need a True/False indicator.
- Out-of-range inputs: If UI prevents setting desired values, check the allowed range [-1e10, 1e10] and step size 0.001.