Macaulay2
»
Documentation
Packages
»
Macaulay2Doc
::
apply(ZZ,Function)
next
|
previous
|
forward
|
backward
| up |
index
|
toc
apply(ZZ,Function) -- apply a function to {0,..., n-1}
Synopsis
Function:
apply
Usage:
apply(n,f)
Inputs:
n
,
an
integer
f
,
a
function
, with one argument
Outputs:
a
list
, obtained by applying
f
to the list of integers {0,..., n-1}
Description
The command
apply(n,f)
is equivalent to
apply(toList(0 .. n-1),f)
.
i1 : apply(10, i -> i^2) o1 = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81} o1 : List
Ways to use this method:
apply(ZZ,Function)
-- apply a function to {0,..., n-1}