to()

Read(758) Label: generate, integer sequence,

Description:

Generate an integer sequence.

Syntax:

to(a,b)

Generate a sequence composed of continuous integers between a and b

to(n) 

Generate a sequence composed of continuous integers from 1 to n

Note:

The function generates a sequence composed of a set of continuous integers from a to b or from 1 to n.

Parameter:

a

The starting integer

b

The ending integer

n

n>0

Option:

@s

Generate a sequence composed of continuous b integers starting from a. If b is less than 0, generate the sequence backward sequentially in descending order

Return value:

A continuous integer sequence

Example:

 

A

 

1

=to(3,7)

[3,4,5,6,7]

2

=to(5,3)

[5,4,3]

3

=to(-2,3)

[-2,-1,0,1,2,3]

4

=to(3,-2)

[3,2,1,0,-1,-2]

5

=to@s(3,4)

[3,4,5,6]

6

=to@s(3,-2)

[3,2]

7

=to(10)

[1,2,3,4,5,6,7,8,9,10]

Related function:

A.to()