ecl-logo Documentation

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.
  • Input
    Output
    General Options
    Messages
  • IncompatibleDimensionsDimensions of array `1` do not match dimensions of range list `2`.
    NotConvertableCannot convert `1`, `2` and `3` into same Units for comparison. Check CompatibleUnitQ for possible conversion.

Examples

Basic Examples  (3)

Tests if a provide value is withing the given range after converting to a common unit:

Can accept spans as well as lists of ranges:

Works with numeric input as well:

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 can be different:

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:

Options  (1)

Inclusive  (1)

The Inclusive option can be used to control inclusive or exclusive matching on the minimum and maximum values:

Attributes  (3)

Listable  (3)

The function is listable by values:

And by ranges:

If the number of ranges match the number of values, the lists are handled pairwise:

Messages  (2)

IncompatibleDimensions  (1)

QuantityArray dimensions must match dimensions of range specification:

NotConvertable  (1)

If unconvertable Units are proved, the NotConvertable message is thrown: