Numeric sequences
Operation | Description |
---|---|
fibonacci, fib |
Fibonacci sequence |
sequence, seq |
Sequence of integers |
Calculates the nth element in the Fibonacci sequence.
Alias: fib
Stack effects:
( n:Int/u -- Int )
Example:
Input | Stack |
---|---|
1 5 seq /fib map |
1 | 1 | 2 | 3 | 5 |
Places all integers from start to end on to the stack. If start is greater than end, the list of integers is in decreasing order.
Alias: seq
Stack effects:
( start:Int end:Int -- Int* )
Example:
Input | Stack |
---|---|
c 4 8 seq |
4 | 5 | 6 | 7 | 8 |
c 8 4 seq |
8 | 7 | 6 | 5 | 4 |