# Interval Arithmetic

Interval[{min,max}] | the interval from min to max |

Interval[{min_{1},max_{1}},{min_{2},max_{2}},...] |

| the union of intervals from to , to , ... |

Representations of real intervals.

This represents all numbers between

and

.

Out[1]= | |

The square of any number between

and

is always between

and

.

Out[2]= | |

Taking the reciprocal gives two distinct intervals.

Out[3]= | |

Abs folds the intervals back together again.

Out[4]= | |

You can use intervals in many kinds of functions.

Out[5]= | |

Some functions automatically generate intervals.

Out[6]= | |

IntervalUnion[interval_{1},interval_{2},...] | find the union of several intervals |

IntervalIntersection[interval_{1},interval_{2},...] |

| find the intersection of several intervals |

IntervalMemberQ[interval,x] | test whether the point x lies within an interval |

IntervalMemberQ[interval_{1},interval_{2}] | test whether lies completely within |

Operations on intervals.

This finds the overlap of the two intervals.

Out[7]= | |

You can use

Max and

Min to find the end points of intervals.

Out[8]= | |

This finds out which of a list of intervals contains the point 7.

Out[9]= | |

You can use intervals not only with exact quantities but also with approximate numbers. Even with machine-precision numbers, *Mathematica* always tries to do rounding in such a way as to preserve the validity of results.

This shows explicitly the interval treated by

*Mathematica* as the machine-precision number

Out[10]= | |

This shows the corresponding interval around

, shifted back to zero.

Out[11]= | |

The same kind of thing works with numbers of any precision.

Out[12]= | |

With ordinary machine-precision arithmetic, this computation gives an incorrect result.

Out[13]= | |

The interval generated here, however, includes the correct value of 0.

Out[14]= | |