Factorial: Difference between revisions
Content added Content deleted
imported>MaD70 (→{{header|APL}}: Recursive definition) |
|||
Line 750: | Line 750: | ||
<syntaxhighlight lang="apl"> FACTORIAL 6 |
<syntaxhighlight lang="apl"> FACTORIAL 6 |
||
720</syntaxhighlight> |
720</syntaxhighlight> |
||
{{works with|Dyalog APL}} |
|||
A recursive definition is also possible: |
|||
<syntaxhighlight lang="apl"> |
|||
fac←{⍵>1 : ⍵×fac ⍵-1 ⋄ 1} |
|||
fac 5 |
|||
120 |
|||
</syntaxhighlight> |
|||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |