RosettaCodeData/Task/Factorial/PowerShell/factorial-3.psh

7 lines
124 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
function Get-Factorial ($x) {
if ($x -eq 0) {
return 1
}
return (Invoke-Expression (1..$x -join '*'))
}