Next: runi() Up: MacAnova Help File Previous: rsolve()   Contents

# run()

Usage:
 ```run(first,last,incr) or run(first,last) or run(last) ```

Keywords: combining variables, variables
```run(First,Last,Incr) will generate a sequence of numbers from First to
Last with step size given in Incr.  The i-th number is computed as
First+(i-1)*Incr (unless it is very close to 0 or Last; see below).  It
is an error if Incr is 0, unless First = Last.

run(First,Last) is the same as run(First,Last,1) if Last > First, and to
run(First,Last,-1) if Last < First.

run(n) does the same as run(1,n) if n is an integer.  This is the most
common usage.

run(vector(First,Last,Incr)) is the same as run(First,Last,Incr).  A
vector argument must be of length 3, so run(vector(First,Last)) is
illegal.

When Incr is (Last-First)/n, where n is an integer, there will be n+1
values, with the (n+1)-th being exactly Last, even if First+n*Incr is
slightly less or greater than Last because of rounding error.

Similarly, if 0 is between First and Last and Incr is -First/n, the
(n+1)-th value will be exactly 0 even if First+n*Incr is not exactly 0
because of rounding error.  In both situations, the value is rounded to
the target value (Last or 0) if abs((First+n*Incr-target)) <
1e-15*abs(Last-First).
```

Gary Oehlert 2003-01-15