Range

Command: Range


Synopsis
[N] Range -> [1 ... N]
[N1 N2] Range -> [N1 ... N2]
[N1 N2 d] Range -> [N1 N1+d N1+2d ...]
Bugs

Description

Range accepts an array which contains either
1) a single integer
2) an interval specified by two integers or two doubles
3) an interval and a stepsize specified by three integers or
three doubles.

Range generates an array with numbers which are in the specified
range. The type of the result corresponds to the type used for
specifying the interval.

Range returns an empty array if the set specified by N1 N2 and d
does not contain any element. This behavior is essential if
Range is used in combination with functional operators like
FoldList and NestList.

File
lib/sli/mathematica.sli
Author
Gewaltig Diesmann
Remarks
Resembles the function Range of Mathematica
Examples

[5] Range -> [1 2 3 4 5]
[2 5] Range -> [2 3 4 5]
[5 2] Range -> []
[5 2 -1] Range -> [5 4 3 2]
[1.0 10.0 2.5] Range -> [1 3.5 6 8.5]