Previous Up Next

5.40.10  Test if an object is in an interval: contains

The contains command takes two arguments; an interval and an object to test.
contains returns 1 if the object is contained in the interval; i.e., if the object is a number then it must be an element of the interval, if the object is another interval it must be a subset of the interval. contains returns 0 otherwise.
Input:

contains(i[0,2],1)

Output:

1

Input:

contains(i[0,2],3)

Output:

0

Input:

contains(i[0,2],i[1,2])

Output:

1

Previous Up Next