RangeQ
RangeQ[value,span]⟹inRange
checks if a given value is inside the provided span.
RangeQ[value,{min,max}]⟹inRange
tests if a given value is inside the range from min to max'.
Details
- The function is unit frendly, and if provided spans and values that match CompatibleUnitQ, will Convert to a common form before performing the check.
- Null can be provided on either side of the range to add no additional restrictions to the maximum or minimum values.
-
IncompatibleDimensions Dimensions of array `1` do not match dimensions of range list `2`. NotConvertable Cannot convert `1`, `2` and `3` into same Units for comparison. Check CompatibleUnitQ for possible conversion.
Input
Output
General Options
Messages
Examples
Basic Examples (3)
Additional Examples (10)
If Null is provided as part of the range, no bounds are placed on that end of the range:
If null is provided on both ends of the range, no restrictions are placed on the value:
One dimensional QuantityArray matching given range:
QuantityArray that does not match:
Range units must be compatible:
QA units must be compatible with range units:
Two dimensional QuantityArray matching given range:
Two dimensional QuantityArray that does not match the given range:
QA units must be compatible with range units: