Range
Range($iMax) generates the list [1, 2, ... , $iMax].
Range($iMin, $iMax) generates the list [$iMin, ... , $iMax].
Range($iMin, $iMax, $iStep) uses increment $iStep, with the last element
in the result being less or equal to $iMax. $iStep cannot be 0. If
$iStep is negative, then the role of $iMin and $iMax are reversed.
If Range fails, 0 is returned.
Example:
Range(5); # returns [1,2,3,4,5]
Range(5,10); # returns [5,6,7,8,9,10]
Range( 5, 7, 0.3); # returns [5, 5.3, 5.6, 5.9, 6.2, 6.5, 6.8]
Range( 5, -4, -2); # returns [5,3,1,-1,-3]
Wolfram Research's Range function documentation is at: http://documents.wolfram.com/mathematica/functions/Range (this project is not affliated with Wolfram Research Incorporated.)
Solutions:
• Range.pl • Range.py • Range.scm • Range.java
