mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
32 lines
492 B
Plaintext
32 lines
492 B
Plaintext
NAME
|
|
count - count elements of list or matrix satisfying a stated condition
|
|
|
|
SYNOPSIS
|
|
count(x, y)
|
|
|
|
TYPES
|
|
x list or matrix
|
|
y string
|
|
|
|
return integer
|
|
|
|
DESCRIPTION
|
|
For count(x, y), y is to be the name of a user-defined function;
|
|
count(x,y) then returns the number of elements of x for which y
|
|
tests as "true".
|
|
|
|
EXAMPLE
|
|
> define f(a) = (a < 5)
|
|
> A = list(1,2,7,6,4,8)
|
|
> count(A, "f")
|
|
3
|
|
|
|
LIMITS
|
|
none
|
|
|
|
LIBRARY
|
|
none
|
|
|
|
SEE ALSO
|
|
select, modify
|