Handbook
Glossary
stirling ( n k -- x )
Vocabulary
math
.
extras
Inputs
n
an
integer
k
an
integer
Outputs
x
an
integer
Word description
Return the Stirling number of the second kind for a set with
n
elements partitioned into
k
disjoint non-empty sets.
Definition
USING:
combinators.short-circuit
kernel
math.extras.private
;
IN:
math.extras
MEMO:
stirling
( n k -- x )
2dup
{
[
=
]
[
nip
1
=
]
}
2||
[
2drop
1
]
[
(stirling)
]
if
;