.. -- range operator
Introductionl..r defines a ``range'' with the left bound
l and the right bound r.
Call(s)
l .. r _range(l, r)
Parametersl, r |
- | arbitrary MuPAD objects |
Returnsan expression of type "_range".
l, r
Related
Functions
Detailsint, 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.Dom::Interval._range is a function of the system kernel.
Example
1A 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
2The 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