### 6.6.7 Testing if an object is in an interval

The contains command determines if an object is in an interval.

- contains takes two arguments:
  - I, an interval.
  - obj, an object.
- contains(I,obj) returns 1 if obj is in I, meaning that either obj is a number which is contained in I or obj is an interval which is a subset of I. It returns 0 otherwise.

#### Examples

contains(i[0,2],1)

1 |  |  |  |  |  |  |  |  |  |

contains(i[0,2],3)

0 |  |  |  |  |  |  |  |  |  |

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

1 |  |  |  |  |  |  |  |  |  |