## `..` -- range operator

#### Introduction

`l..r` defines a ``range'' with the left bound `l` and the right bound `r`.

#### Call(s)

l .. r `_range(l, r)`

#### Parameters

`l, r` | - | arbitrary MuPAD objects

#### Returns

an expression of type `"_range"`.

### Overloadable:

`l`, `r`

#### Related Functions

`$`, `Dom::Interval`

#### Details

- A range is a technical construct that is used to specify ranges of numbers when calling various system functions such as `int`, `array`, `op`, or the sequence operator `$`. Usually, `l..r` represents a real interval (e.g., `int(f(x), x = l..r)`), or the sequence of integers from `l` to `r`.
- `_range(l, r)` is equivalent to `l..r`.
- To create and operate on intervals in a mathematical sense, use the data type `Dom::Interval`.
- `_range` is a function of the system kernel.

#### Example 1

A range can be defined with the `..` operator as well as with a call to the function `_range`:

    >> _range(1, 42), 1..42

                                   1..42, 1..42

In the following call, the range represents an interval:

    >> int(x, x = l..r)

                                       2    2
                                      r    l
                                      -- - --
                                      2    2

Ranges can be used for accessing the operands of expressions or to define the dimension of an array:

    >> op(f(a, b, c, d, e), 2..4)

                                      b, c, d

    >> array(1..3, [a1, a2,a3])

                                  +-          -+
                                  | a1, a2, a3 |
                                  +-          -+

Ranges can also be used for creating expression sequences:

    >> i^3 $ i = 1..5

                                 1, 8, 27, 64, 125

#### Example 2

The range operator `..` is a technical device that does not check its parameters with respect to their semantics. It just creates a range which is interpreted in the context in which it is used later. Any bounds are accepted:

    >> float(PI) .. -sqrt(2)/3

                                                1/2
                                               2
                                3.141592654..- ----
                                                3

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000