interval-contains? ( x interval -- ? )
Factor handbook » The language » Numbers » Intervals » Set-theoretic operations on intervals

Next:interval-subset? ( i1 i2 -- ? )


Vocabulary
math.intervals

Inputs
xa real
intervalan interval


Outputs
?a boolean


Word description
Tests if x is contained in interval.

Examples
USING: math.intervals prettyprint ; 1.5 1 2 [a,b] interval-contains? .
t

Half-open endpoints are not contained:
USING: math.intervals prettyprint ; 1 1 2 (a,b] interval-contains? .
f

The empty interval obviously does not contain an interval:
USING: math.intervals prettyprint ; 1 2 (a,b] empty-interval interval-contains? .
f


See also
interval-subset?

Definition


Methods