Combinations and permutations: Difference between revisions

Content deleted Content added
Added Haskell version
Rdm (talk | contribs)
Line 524: Line 524:


<lang J>C=: !
<lang J>C=: !
P=: (<: * (*/@}. 1+i.))"0</lang>
P=: (%&!&x:~ * <:)"0</lang>


C is a primitive, but we will give it a name for this task. P could be defined using %&!~ but that approach would overflow for large arguments even when the result would have been representable.
C is a primitive, but we will give it a name for this task.


Example use:
Example use: