mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.10.2t30
This commit is contained in:
49
help/head
Normal file
49
help/head
Normal file
@@ -0,0 +1,49 @@
|
||||
NAME
|
||||
head - create a list of specified size from the head of a list
|
||||
|
||||
SYNOPSIS
|
||||
head(x, y)
|
||||
|
||||
TYPES
|
||||
x list
|
||||
y int
|
||||
|
||||
return list
|
||||
|
||||
DESCRIPTION
|
||||
If 0 <= y <= size(x), head(x,y) returns a list of size y whose
|
||||
elements in succession have values x[[0]]. x[[1]], ..., x[[y - 1]].
|
||||
|
||||
If y > size(x), head(x,y) is a copy of x.
|
||||
|
||||
If -size(x) < y < 0, head(x,y) returns a list of size (size(x) + y)
|
||||
whose elements in succession have values x[[0]]. x[[1]], ...,
|
||||
i.e. a copy of x from which the last -y members have been deleted.
|
||||
|
||||
If y <= -size(x), head(x,y) returns a list with no members.
|
||||
|
||||
For any integer y, x == join(head(x,y), tail(x,-y)).
|
||||
|
||||
EXAMPLE
|
||||
> A = list(2, 3, 5, 7, 11)
|
||||
> head(A, 2)
|
||||
|
||||
list (2 members, 2 nonzero):
|
||||
[[0]] = 2
|
||||
[[1]] = 3
|
||||
|
||||
> head(A, -2)
|
||||
|
||||
list (3 members, 3 nonzero):
|
||||
[[0]] = 2
|
||||
[[1]] = 3
|
||||
[[2]] = 5
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LIBRARY
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
tail, segment
|
Reference in New Issue
Block a user