In Range and Coerce
- Updated2023-02-17
- 4 minute(s) read
In Range and Coerce
Determines whether the input value falls within a range specified by the upper and lower limits and optionally coerces the value to fall within the range.
To allow the node to perform coercion, select Elements in the Behavior section of the Item tab.

Inputs/Outputs

upper limit
The upper limit of the range.
By default, this node excludes the value of upper limit in the range. You can configure the node to include the value of upper limit in the range by selecting the Include upper limit option in the Behavior section of the Item tab. This option affects only the value of in range?. This node always coerces x to the exact values of upper limit and lower limit, regardless of whether you select this option.
Data Type Changes on FPGA
When you add this node to a document targeted to an FPGA, this input has a default data type that uses fewer hardware resources at compile time.

x
The value to test in the range and optionally coerce if it does not fall between the upper and lower limits. This input changes to waveform when the data type is a waveform.
This input supports all data types.
Data Type Changes on FPGA
When you add this node to a document targeted to an FPGA, this output has a default data type that uses fewer hardware resources at compile time.

lower limit
The lower limit of the range.
By default, this node includes the value of lower limit in the range. You can configure the node to exclude the value of lower limit in the range by deselecting the Include lower limit option in the Behavior section of the Item tab. This option affects only the value of in range?. This node always coerces x to the exact values of upper limit and lower limit, regardless of whether you select this option.
Data Type Changes on FPGA
When you add this node to a document targeted to an FPGA, this input has a default data type that uses fewer hardware resources at compile time.

in range?
A Boolean value that indicates whether the input value is in range.
True | x is in range. |
False | x is out of range. This node also returns False if x, upper limit, or lower limit is NaN. |
In Compare Elements mode, the data type structure of in range? matches the data type structure of x, with each scalar replaced by a Boolean value.

coerced
The coerced or unchanged input value.
Comparison Modes and x Value Behavior
If x is within the range set by the upper limit and lower limit or if the node is in Compare Aggregates mode, the value is unchanged. If x is not in range and the node is in Compare Elements mode, the node converts the value to the same value as upper limit or lower limit. If upper limit, x, or lower limit is NaN, coerced is NaN.
Data Type Changes on FPGA
When you add this node to a document targeted to an FPGA, this output has a default data type that uses fewer hardware resources at compile time.
Include upper limit
Include the value of upper limit in the range that this node evaluates. This option affects only the value of in range?. The node always coerces x to the exact values of upper limit and lower limit, regardless of whether you select this option.
Include lower limit
Include the value of lower limit in the range that this node evaluates. This option affects only the value of in range?. The node always coerces x to the exact values of upper limit and lower limit, regardless of whether you select this option.