RosettaCodeData/Task/Evaluate-binomial-coefficients/Oz/evaluate-binomial-coefficients.oz

11 lines
173 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
declare
fun {BinomialCoeff N K}
{List.foldL {List.number 1 K 1}
fun {$ Z I}
Z * (N-I+1) div I
end
1}
end
in
{Show {BinomialCoeff 5 3}}